add settings page with reset app: clears keychain secrets and SQLite cache

This commit is contained in:
2026-05-18 04:04:24 +08:00
parent fc81e0889a
commit 9c856129d8
5 changed files with 117 additions and 0 deletions
@@ -199,6 +199,24 @@ export const Wallet = () => {
}
}
const resetApp = async () => {
if (!electrobun.rpc) return false
const [ok] = await tryCatch(
electrobun.rpc.request.resetApp({}),
)
if (!ok) return false
seed = ''
address = ''
balance = '0'
error = ''
tokenBalances = []
transactions = []
apiKey = ''
vaultExists = false
passwordHash = ''
return true
}
const setPassword = async (password: string) => {
if (!electrobun.rpc) return
const ph = await hashPassword(password)
@@ -473,6 +491,7 @@ export const Wallet = () => {
unlockWithBiometrics,
unlockWithPassword,
setPassword,
resetApp,
saveVault,
switchNetwork,
saveApiKey,