File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 openChangeEmailDialog ,
1111 openDeleteAccountDialog ,
1212 removeAllSessions ,
13+ resetApp ,
1314} from '../state/user'
1415import { hostingMode } from '../config'
1516import { selectCommandCenterDisabled , setCommandCenterOpen , useSelector } from '../state/store'
@@ -215,6 +216,11 @@ export const CommandCenter = () => {
215216 label : 'Third Party Licenses' ,
216217 onClick : ( ) => window . open ( '/licenses.html' , '_blank' ) ,
217218 } ,
219+ {
220+ id : 'resetApp' ,
221+ label : 'Reset App (delete all local data)' ,
222+ onClick : resetApp ,
223+ } ,
218224 ]
219225
220226 const enabledCommands = commands . filter ( ( c ) => ! c . disabled )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {syncNotes} from './notes'
2323import { Feature } from '../business/models'
2424import { parseSubscriptionToken } from '../business/misc'
2525import { hostingMode } from '../config'
26+ import { openConfirmModalWithBackHandler } from '../helpers/openConfirmModal'
2627
2728export type UserState = {
2829 user : {
@@ -732,6 +733,22 @@ export const removeAllSessions = async () => {
732733 }
733734}
734735
736+ export const resetApp = ( ) =>
737+ openConfirmModalWithBackHandler ( {
738+ id : 'resetApp' ,
739+ title : 'Reset App' ,
740+ children : 'Are you sure you want to delete all local data?' ,
741+ labels : {
742+ confirm : 'Reset' ,
743+ cancel : 'Cancel' ,
744+ } ,
745+ onConfirm : async ( ) => {
746+ await db . delete ( )
747+ localStorage . clear ( )
748+ window . location . reload ( )
749+ } ,
750+ } )
751+
735752// subscriptions
736753export const registerUserSubscriptions = ( ) => {
737754 subscribe (
You can’t perform that action at this time.
0 commit comments