Skip to content

Commit

Permalink
fix(wallet): make sure restart wallet deletes everything possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnk committed Dec 27, 2023
1 parent 3db9d4f commit 5359602
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"superjson": "^2.2.1",
"tailwind-merge": "^2.1.0",
"tailwindcss-animate": "^1.0.7",
"webextension-polyfill": "^0.10.0",
"zod": "^3.22.4",
"zustand": "^4.4.7"
},
Expand All @@ -111,6 +112,7 @@
"@types/mocha": "^10.0.6",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/webextension-polyfill": "^0.10.7",
"esbuild-plugin-polyfill-node": "^0.3.0",
"esbuild-plugin-svgr": "2.0.0",
"graphql-request": "^6.1.0",
Expand Down
12 changes: 5 additions & 7 deletions packages/features/src/components/restart-wallet-alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useVault } from '@palladxyz/vault'
import { storage } from 'webextension-polyfill'

import {
AlertDialog,
Expand All @@ -11,8 +12,6 @@ import {
AlertDialogTitle
} from '@/components/ui/alert-dialog'

import { useAppStore } from '..'

type RestartWalletAlertProps = {
open: boolean
setOpen: (open: boolean) => void
Expand All @@ -22,12 +21,11 @@ export const RestartWalletAlert = ({
open,
setOpen
}: RestartWalletAlertProps) => {
const setVaultStateUninitialized = useAppStore(
(state) => state.setVaultStateUninitialized
)
const confirm = () => {
const confirm = async () => {
useVault.persist.clearStorage()
setVaultStateUninitialized()
await storage.local.clear()
await storage.session.clear()
await storage.managed.clear()
setOpen(false)
window.close()
}
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5359602

Please sign in to comment.