internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20319 additions and 4811 deletions
@@ -0,0 +1,47 @@
import { InternalEventBusInterface } from '@standardnotes/snjs'
import { WebApplication } from '@/Application/WebApplication'
import { action, makeObservable, observable } from 'mobx'
import { AbstractViewController } from './Abstract/AbstractViewController'
export class VaultSelectionMenuController extends AbstractViewController {
open = false
shouldAnimateCloseMenu = false
constructor(application: WebApplication, eventBus: InternalEventBusInterface) {
super(application, eventBus)
makeObservable(this, {
open: observable,
shouldAnimateCloseMenu: observable,
setOpen: action,
setShouldAnimateCloseMenu: action,
toggle: action,
closeVaultSelectionMenu: action,
})
}
setOpen = (open: boolean): void => {
this.open = open
}
setShouldAnimateCloseMenu = (shouldAnimate: boolean): void => {
this.shouldAnimateCloseMenu = shouldAnimate
}
toggle = (): void => {
if (this.open) {
this.closeVaultSelectionMenu()
} else {
this.setOpen(true)
}
}
closeVaultSelectionMenu = (): void => {
this.setShouldAnimateCloseMenu(true)
setTimeout(() => {
this.setOpen(false)
this.setShouldAnimateCloseMenu(false)
}, 150)
}
}