wip: refactor

This commit is contained in:
Ren Amamiya
2023-08-15 21:13:58 +07:00
parent 6e28bcdb96
commit 2d53019c10
36 changed files with 603 additions and 552 deletions

View File

@@ -40,7 +40,6 @@ export function MigrateScreen() {
const [passwordInput, setPasswordInput] = useState('password');
const [loading, setLoading] = useState(false);
const { account } = useAccount();
const { db } = useStorage();
// toggle private key
@@ -69,10 +68,10 @@ export function MigrateScreen() {
const stronghold = await Stronghold.load(`${dir}/lume.stronghold`, data.password);
if (!db.secureDB) db.secureDB = stronghold;
await db.secureSave(account.pubkey, account.privkey);
await db.secureSave(db.account.pubkey, db.account.privkey);
// add privkey to state
setPrivkey(account.privkey);
setPrivkey(db.account.privkey);
// remove privkey in db
await removePrivkey();
// clear cache