diff --git a/apps/web/src/dialogs/settings/profile-settings.ts b/apps/web/src/dialogs/settings/profile-settings.ts index 41ea73096..3cf13727a 100644 --- a/apps/web/src/dialogs/settings/profile-settings.ts +++ b/apps/web/src/dialogs/settings/profile-settings.ts @@ -35,6 +35,7 @@ import { EmailChangeDialog } from "../email-change-dialog"; import { RecoveryKeyDialog } from "../recovery-key-dialog"; import { UserProfile } from "./components/user-profile"; import { SettingsGroup } from "./types"; +import Config from "../../utils/config"; export const ProfileSettings: SettingsGroup[] = [ { @@ -90,6 +91,29 @@ export const ProfileSettings: SettingsGroup[] = [ } ] }, + { + key: "delete-data-for-not-logged-in-user", + title: strings.deleteData(), + description: strings.deleteAccountDesc(), + keywords: [ + strings.deleteData(), + strings.deleteAccount(), + strings.clear() + ], + isHidden: () => Boolean(useUserStore.getState().isLoggedIn), + components: [ + { + type: "button", + variant: "error", + title: strings.deleteData(), + action: async () => { + Config.clear(); + await db.reset(); + window.location.reload(); + } + } + ] + }, { key: "account-removal", title: strings.deleteAccount(), diff --git a/packages/intl/src/strings.ts b/packages/intl/src/strings.ts index d05967901..a31841975 100644 --- a/packages/intl/src/strings.ts +++ b/packages/intl/src/strings.ts @@ -2632,5 +2632,6 @@ Use this if changes from other devices are not appearing on this device. This wi expiryDate: () => t`Expiry date`, exportCsv: () => t`Export CSV`, importCsv: () => t`Import CSV`, - noContent: () => t`This note is empty` + noContent: () => t`This note is empty`, + deleteData: () => t`Delete data` };