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:
01zulfi
2026-02-25 11:36:32 +05:00
committed by GitHub
parent e60370d4dc
commit a8d4e6c754
2 changed files with 4 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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"
}