mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-05-18 13:16:11 +02:00
web: fix vault not marked as created when vault is created from locking note (#9394)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import { showPasswordDialog } from "../dialogs/password-dialog";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { VAULT_ERRORS } from "@notesnook/core";
|
||||
import { strings } from "@notesnook/intl";
|
||||
import { useStore as useAppStore } from "../stores/app-store";
|
||||
|
||||
class Vault {
|
||||
static async createVault() {
|
||||
@@ -34,6 +35,7 @@ class Vault {
|
||||
},
|
||||
validate: async ({ password }) => {
|
||||
await db.vault.create(password);
|
||||
useAppStore.getState().setIsVaultCreated(true);
|
||||
showToast("success", strings.vaultCreated());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,10 +41,8 @@ export const VaultSettings: SettingsGroup[] = [
|
||||
{
|
||||
type: "button",
|
||||
title: strings.create(),
|
||||
action: () => {
|
||||
Vault.createVault().then((res) => {
|
||||
useAppStore.getState().setIsVaultCreated(res);
|
||||
});
|
||||
action: async () => {
|
||||
await Vault.createVault();
|
||||
},
|
||||
variant: "secondary"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user