mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
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:
@@ -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(),
|
||||
|
||||
@@ -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`
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user