mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
move storage defaults out to app
This commit is contained in:
parent
35039fdae2
commit
12533dd951
@ -1,20 +1,21 @@
|
|||||||
import { StorageService } from '../../abstractions/storage.service';
|
import { StorageService } from '../../abstractions/storage.service';
|
||||||
|
|
||||||
import { ConstantsService } from '../../services/constants.service';
|
|
||||||
|
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
const Store = require('electron-store');
|
const Store = require('electron-store');
|
||||||
|
|
||||||
export class ElectronStorageService implements StorageService {
|
export class ElectronStorageService implements StorageService {
|
||||||
private store: any;
|
private store: any;
|
||||||
|
|
||||||
constructor() {
|
constructor(defaults?: any) {
|
||||||
const storeConfig: any = {
|
const storeConfig: any = {
|
||||||
defaults: {} as any,
|
defaults: {} as any,
|
||||||
name: 'data',
|
name: 'data',
|
||||||
};
|
};
|
||||||
// Default lock options to "on restart".
|
|
||||||
storeConfig.defaults[ConstantsService.lockOptionKey] = -1;
|
if (defaults != null) {
|
||||||
|
storeConfig.defaults = Object.assign({}, storeConfig.defaults, defaults);
|
||||||
|
}
|
||||||
|
|
||||||
this.store = new Store(storeConfig);
|
this.store = new Store(storeConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user