diff --git a/jslib b/jslib index 983a7b47..35039fda 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 983a7b474c344475edc3290d0ce1894a92794752 +Subproject commit 35039fdae2038f6bdfbdef6616b2bfae0053d47b diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 6be13856..e00ff72d 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -796,7 +796,7 @@ "message": "Restart To Update" }, "restartToUpdateDesc": { - "message": "Version $VERSION_NUM$ is ready to install. You must restart Bitwarden to complete the installation. Do you want to restart and update now?", + "message": "Version $VERSION_NUM$ is ready to install. You must restart the application to complete the installation. Do you want to restart and update now?", "placeholders": { "version_num": { "content": "$1", diff --git a/src/main.ts b/src/main.ts index 0aeafdf1..959f2cf0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { app, BrowserWindow } from 'electron'; import * as path from 'path'; -import { DesktopMainMessagingService } from './services/desktopMainMessaging.service'; import { I18nService } from './services/i18n.service'; import { MenuMain } from './main/menu.main'; @@ -13,6 +12,7 @@ import { ConstantsService } from 'jslib/services/constants.service'; import { KeytarStorageListener } from 'jslib/electron/keytarStorageListener'; import { ElectronLogService } from 'jslib/electron/services/electronLog.service'; +import { ElectronMainMessagingService } from 'jslib/electron/services/electronMainMessaging.service'; import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service'; import { WindowMain } from 'jslib/electron/window.main'; @@ -20,7 +20,7 @@ export class Main { logService: ElectronLogService; i18nService: I18nService; storageService: ElectronStorageService; - messagingService: DesktopMainMessagingService; + messagingService: ElectronMainMessagingService; keytarStorageListener: KeytarStorageListener; windowMain: WindowMain; @@ -56,7 +56,6 @@ export class Main { this.logService = new ElectronLogService(null, app.getPath('userData')); this.i18nService = new I18nService('en', './locales/'); this.storageService = new ElectronStorageService(); - this.messagingService = new DesktopMainMessagingService(this); this.windowMain = new WindowMain(this.storageService); this.messagingMain = new MessagingMain(this); @@ -64,6 +63,10 @@ export class Main { this.menuMain = new MenuMain(this); this.powerMonitorMain = new PowerMonitorMain(this); + this.messagingService = new ElectronMainMessagingService(this.windowMain, (message) => { + this.messagingMain.onMessage(message); + }); + this.keytarStorageListener = new KeytarStorageListener('Bitwarden'); } diff --git a/src/services/desktopMainMessaging.service.ts b/src/services/desktopMainMessaging.service.ts deleted file mode 100644 index 8c547705..00000000 --- a/src/services/desktopMainMessaging.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MessagingService } from 'jslib/abstractions/messaging.service'; - -import { Main } from '../main'; - -export class DesktopMainMessagingService implements MessagingService { - constructor(private main: Main) { } - - send(subscriber: string, arg: any = {}) { - const message = Object.assign({}, { command: subscriber }, arg); - this.main.messagingMain.onMessage(message); - if (this.main.windowMain.win != null) { - this.main.windowMain.win.webContents.send('messagingService', message); - } - } -}