diff --git a/package-lock.json b/package-lock.json index 2b82c396..b4e77421 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3638,7 +3638,7 @@ "dev": true }, "duo_web_sdk": { - "version": "git+https://github.com/duosecurity/duo_web_sdk.git#410a9186cc34663c4913b17d6528067cd3331f1d", + "version": "git+https://github.com/duosecurity/duo_web_sdk.git#4c5df7a4001b8b03e2d7130d9096b697c4032e77", "from": "git+https://github.com/duosecurity/duo_web_sdk.git" }, "duplexer3": { diff --git a/package.json b/package.json index ed81a3cb..a5c371ad 100644 --- a/package.json +++ b/package.json @@ -221,6 +221,7 @@ "artifactName": "${productName}-${version}-${arch}.${ext}" }, "snap": { + "autoStart": true, "confinement": "strict", "plugs": [ "default", diff --git a/src/app/accounts/settings.component.ts b/src/app/accounts/settings.component.ts index 8a3840d7..26e1137d 100644 --- a/src/app/accounts/settings.component.ts +++ b/src/app/accounts/settings.component.ts @@ -54,6 +54,7 @@ export class SettingsComponent implements OnInit { alwaysShowDock: boolean; showAlwaysShowDock: boolean = false; openAtLogin: boolean; + requireEnableTray: boolean = false; enableTrayText: string; enableTrayDescText: string; @@ -71,6 +72,9 @@ export class SettingsComponent implements OnInit { private userService: UserService, private cryptoService: CryptoService) { const isMac = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop; + // Workaround to avoid ghosting trays https://github.com/electron/electron/issues/17622 + this.requireEnableTray = this.platformUtilsService.getDevice() === DeviceType.LinuxDesktop; + const trayKey = isMac ? 'enableMenuBar' : 'enableTray'; this.enableTrayText = this.i18nService.t(trayKey); this.enableTrayDescText = this.i18nService.t(trayKey + 'Desc'); @@ -271,17 +275,44 @@ export class SettingsComponent implements OnInit { } async saveCloseToTray() { + if (this.requireEnableTray) { + this.enableTray = true; + await this.storageService.save(ElectronConstants.enableTrayKey, this.enableTray); + } + await this.storageService.save(ElectronConstants.enableCloseToTrayKey, this.enableCloseToTray); this.callAnalytics('CloseToTray', this.enableCloseToTray); } async saveTray() { + if (this.requireEnableTray && !this.enableTray && (this.startToTray || this.enableCloseToTray)) { + const confirm = await this.platformUtilsService.showDialog( + this.i18nService.t('confirmTrayDesc'), this.i18nService.t('confirmTrayTitle'), + this.i18nService.t('yes'), this.i18nService.t('no'), 'warning'); + + if (confirm) { + this.startToTray = false; + await this.storageService.save(ElectronConstants.enableStartToTrayKey, this.startToTray); + this.enableCloseToTray = false; + await this.storageService.save(ElectronConstants.enableCloseToTrayKey, this.enableCloseToTray); + } else { + this.enableTray = true; + } + + return; + } + await this.storageService.save(ElectronConstants.enableTrayKey, this.enableTray); this.callAnalytics('Tray', this.enableTray); this.messagingService.send(this.enableTray ? 'showTray' : 'removeTray'); } async saveStartToTray() { + if (this.requireEnableTray) { + this.enableTray = true; + await this.storageService.save(ElectronConstants.enableTrayKey, this.enableTray); + } + await this.storageService.save(ElectronConstants.enableStartToTrayKey, this.startToTray); this.callAnalytics('StartToTray', this.startToTray); } diff --git a/src/app/vault/groupings.component.html b/src/app/vault/groupings.component.html index 5403eb00..75c88863 100644 --- a/src/app/vault/groupings.component.html +++ b/src/app/vault/groupings.component.html @@ -50,15 +50,16 @@ -