A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix vault not marked as created when vault is created from locking note (#9394)
01zulfia8d4e6c7545e
diff --git a/apps/web/src/common/vault.ts b/apps/web/src/common/vault.tsindex 140f1cd5b..39ef84cd5 100644--- a/apps/web/src/common/vault.ts+++ b/apps/web/src/common/vault.ts@@ -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;}diff --git a/apps/web/src/dialogs/settings/vault-settings.tsx b/apps/web/src/dialogs/settings/vault-settings.tsxindex becda4006..53d039c2d 100644--- a/apps/web/src/dialogs/settings/vault-settings.tsx+++ b/apps/web/src/dialogs/settings/vault-settings.tsx@@ -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"}