28 lines
466 B
JavaScript

/**
* App-level reactive state.
*/
import { Store } from './store.js'
import { stopAutoLock } from './security.js'
export class AppStore extends Store {
constructor() {
super({
isUnlocked: false,
encryptionKey: null,
salt: null,
})
}
/**
* Lock the vault — clear the key from memory.
*/
lockVault() {
stopAutoLock()
this.encryptionKey = null
this.isUnlocked = false
}
}
export const app = new AppStore()