1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-13 01:58:44 +02:00

move storage defaults out to app

This commit is contained in:
Kyle Spearrin 2018-04-26 16:17:11 -04:00
parent 35039fdae2
commit 12533dd951

View File

@ -1,20 +1,21 @@
import { StorageService } from '../../abstractions/storage.service';
import { ConstantsService } from '../../services/constants.service';
// tslint:disable-next-line
const Store = require('electron-store');
export class ElectronStorageService implements StorageService {
private store: any;
constructor() {
constructor(defaults?: any) {
const storeConfig: any = {
defaults: {} as any,
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);
}