mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
mobile: allow changin primary 2fa
This commit is contained in:
committed by
Abdullah Atta
parent
8cb3cb6b19
commit
5a228ce5fe
@@ -60,8 +60,8 @@ export const Settings = () => {
|
||||
<SettingsStack.Navigator
|
||||
initialRouteName="SettingsHome"
|
||||
screenListeners={{
|
||||
beforeRemove: (e) => {
|
||||
if (e.target?.startsWith("SettingsGroup")) {
|
||||
focus: (e) => {
|
||||
if (e.target?.startsWith("SettingsHome-")) {
|
||||
useNavigationStore.getState().update({ name: "Settings" }, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,17 +179,15 @@ export const settingsGroups: SettingSection[] = [
|
||||
sections: [
|
||||
{
|
||||
id: "enable-2fa",
|
||||
name: "Enable two-factor authentication",
|
||||
name: "Change primary two-factor authentication",
|
||||
modifer: () => {
|
||||
verifyUser("global", async () => {
|
||||
MFASheet.present();
|
||||
});
|
||||
},
|
||||
useHook: () => useUserStore((state) => state.user),
|
||||
hidden: (user) => {
|
||||
return !!(user as User)?.mfa?.isEnabled;
|
||||
},
|
||||
description: "Increased security for your account"
|
||||
description:
|
||||
"Change your current two-factor authentication method"
|
||||
},
|
||||
{
|
||||
id: "2fa-fallback",
|
||||
@@ -241,23 +239,6 @@ export const settingsGroups: SettingSection[] = [
|
||||
},
|
||||
description:
|
||||
"View and save recovery codes for to recover your account"
|
||||
},
|
||||
{
|
||||
id: "disabled-2fa",
|
||||
name: "Disable two-factor authentication",
|
||||
modifer: () => {
|
||||
verifyUser("global", async () => {
|
||||
await db.mfa?.disable();
|
||||
const user = await db.user?.fetchUser();
|
||||
useUserStore.getState().setUser(user);
|
||||
});
|
||||
},
|
||||
|
||||
useHook: () => useUserStore((state) => state.user),
|
||||
hidden: (user) => {
|
||||
return !(user as User)?.mfa?.isEnabled;
|
||||
},
|
||||
description: "Decreased security for your account"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user