1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-26 21:23:34 +00:00

settings and lock options

This commit is contained in:
Kyle Spearrin
2018-02-10 23:24:22 -05:00
parent 692e5b7dbc
commit 132c59f8fc
14 changed files with 278 additions and 77 deletions

View File

@@ -0,0 +1,14 @@
import { MessagingService } from 'jslib/abstractions';
import { MessagingMain } from '../main/messaging.main';
import { WindowMain } from '../main/window.main';
export class DesktopMainMessagingService implements MessagingService {
constructor(private windowMain: WindowMain, private messagingMain: MessagingMain) { }
send(subscriber: string, arg: any = {}) {
const message = Object.assign({}, { command: subscriber }, arg);
this.windowMain.win.webContents.send('messagingService', message);
this.messagingMain.onMessage(message);
}
}

View File

@@ -4,7 +4,7 @@ import { MessagingService } from 'jslib/abstractions';
import { BroadcasterService } from '../app/services/broadcaster.service';
export class DesktopMessagingService implements MessagingService {
export class DesktopRendererMessagingService implements MessagingService {
constructor(private broadcasterService: BroadcasterService) {
ipcRenderer.on('messagingService', async (event: any, message: any) => {
if (message.command) {

View File

@@ -7,7 +7,7 @@ export class DesktopSecureStorageService implements StorageService {
action: 'getPassword',
key: key,
});
return Promise.resolve(val ? JSON.parse(val) as T : null);
return Promise.resolve(val != null ? JSON.parse(val) as T : null);
}
async save(key: string, obj: any): Promise<any> {

View File

@@ -7,7 +7,7 @@ const store = new Store();
export class DesktopStorageService implements StorageService {
get<T>(key: string): Promise<T> {
const val = store.get(key) as T;
return Promise.resolve(val ? val : null);
return Promise.resolve(val != null ? val : null);
}
save(key: string, obj: any): Promise<any> {