mirror of
https://github.com/bitwarden/desktop
synced 2025-12-21 02:33:15 +00:00
move to base menu and keytar storage from jslib
This commit is contained in:
@@ -1,17 +1,7 @@
|
||||
import {
|
||||
app,
|
||||
ipcMain,
|
||||
} from 'electron';
|
||||
|
||||
import {
|
||||
deletePassword,
|
||||
getPassword,
|
||||
setPassword,
|
||||
} from 'keytar';
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
import { Main } from '../main';
|
||||
|
||||
const KeytarService = 'Bitwarden';
|
||||
const SyncInterval = 5 * 60 * 1000; // 5 minutes
|
||||
|
||||
export class MessagingMain {
|
||||
@@ -22,25 +12,6 @@ export class MessagingMain {
|
||||
init() {
|
||||
this.scheduleNextSync();
|
||||
ipcMain.on('messagingService', async (event: any, message: any) => this.onMessage(message));
|
||||
|
||||
ipcMain.on('keytar', async (event: any, message: any) => {
|
||||
try {
|
||||
let val: string = null;
|
||||
if (message.action && message.key) {
|
||||
if (message.action === 'getPassword') {
|
||||
val = await getPassword(KeytarService, message.key);
|
||||
} else if (message.action === 'setPassword' && message.value) {
|
||||
await setPassword(KeytarService, message.key, message.value);
|
||||
} else if (message.action === 'deletePassword') {
|
||||
await deletePassword(KeytarService, message.key);
|
||||
}
|
||||
}
|
||||
|
||||
event.returnValue = val;
|
||||
} catch {
|
||||
event.returnValue = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMessage(message: any) {
|
||||
|
||||
Reference in New Issue
Block a user