web: add delete data option for not logged in user

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2025-04-10 10:56:05 +05:00
committed by Ammar Ahmed
parent f22937e1eb
commit d3ea51cc01
2 changed files with 26 additions and 1 deletions

View File

@@ -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(),

View File

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