feat: soft biometrics lock (#1793)
This commit is contained in:
26
packages/web/src/javascripts/Controllers/PaneController.ts
Normal file
26
packages/web/src/javascripts/Controllers/PaneController.ts
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user