config for storage
This commit is contained in:
parent
3ea4842351
commit
4336212a00
|
@ -1,8 +1,23 @@
|
|||
import { StorageService } from 'jslib/abstractions';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
// tslint:disable-next-line
|
||||
const Store = require('electron-store');
|
||||
const store = new Store();
|
||||
|
||||
const storeConfig: any = {
|
||||
defaults: {} as any,
|
||||
name: 'bitwarden-data',
|
||||
};
|
||||
|
||||
// Default lock options to "on restart".
|
||||
storeConfig.defaults[ConstantsService.lockOptionKey] = -1;
|
||||
// Portable builds should not use app data
|
||||
if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
|
||||
storeConfig.cwd = process.env.PORTABLE_EXECUTABLE_DIR;
|
||||
}
|
||||
|
||||
const store = new Store(storeConfig);
|
||||
|
||||
export class DesktopStorageService implements StorageService {
|
||||
get<T>(key: string): Promise<T> {
|
||||
|
|
Loading…
Reference in New Issue