feat: soft biometrics lock (#1793)

This commit is contained in:
Mo
2022-10-13 15:48:36 -05:00
committed by GitHub
parent 44a556adf6
commit 1a2dde2e0e
9 changed files with 75 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
import { AppPaneId } from './../Components/ResponsivePane/AppPaneMetadata'
import { isMobileScreen } from '@/Utils'
import { makeObservable, observable, action } from 'mobx'
export class PaneController {
currentPane: AppPaneId = isMobileScreen() ? AppPaneId.Items : AppPaneId.Editor
previousPane: AppPaneId = isMobileScreen() ? AppPaneId.Items : AppPaneId.Editor
constructor() {
makeObservable(this, {
currentPane: observable,
previousPane: observable,
setCurrentPane: action,
setPreviousPane: action,
})
}
setCurrentPane(pane: AppPaneId): void {
this.currentPane = pane
}
setPreviousPane(pane: AppPaneId): void {
this.previousPane = pane
}
}

View File

@@ -1,3 +1,4 @@
import { PaneController } from './PaneController'
import { RouteType, storage, StorageKey } from '@standardnotes/ui-services'
import { WebApplication } from '@/Application/Application'
import { AccountMenuController } from '@/Controllers/AccountMenu/AccountMenuController'
@@ -56,6 +57,7 @@ export class ViewControllerManager {
readonly selectionController: SelectedItemsController
readonly historyModalController: HistoryModalController
readonly linkingController: LinkingController
readonly paneController: PaneController
public isSessionsModalVisible = false
@@ -71,6 +73,8 @@ export class ViewControllerManager {
this.subscriptionManager = application.subscriptions
this.paneController = new PaneController()
this.preferencesController = new PreferencesController(application, this.eventBus)
this.selectionController = new SelectedItemsController(application, this.eventBus)
@@ -207,6 +211,7 @@ export class ViewControllerManager {
this.historyModalController.deinit()
;(this.historyModalController as unknown) = undefined
;(this.paneController as unknown) = undefined
destroyAllObjectProperties(this)
}