From 643e5a6a2aece942500ae08090a4a3868b8cb9d0 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 6 Sep 2018 18:56:23 +0100 Subject: [PATCH] Electron: Resolves #714: Allow starting application minimised in the tray icon --- ElectronClient/app/app.js | 4 ++++ ReactNativeClient/lib/models/Setting.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ElectronClient/app/app.js b/ElectronClient/app/app.js index 46264d96a..79dc737b5 100644 --- a/ElectronClient/app/app.js +++ b/ElectronClient/app/app.js @@ -758,6 +758,10 @@ class Application extends BaseApplication { AlarmService.garbageCollect(); }, 1000 * 60 * 60); + if (Setting.value('startMinimized') && Setting.value('showTrayIcon')) { + bridge().window().hide(); + } + ResourceService.runInBackground(); if (Setting.value('env') === 'dev') { diff --git a/ReactNativeClient/lib/models/Setting.js b/ReactNativeClient/lib/models/Setting.js index bc85f5e6b..d9c60a645 100644 --- a/ReactNativeClient/lib/models/Setting.js +++ b/ReactNativeClient/lib/models/Setting.js @@ -93,6 +93,8 @@ class Setting extends BaseModel { return platform === 'linux' ? _('Note: Does not work in all desktop environments.') : null; }}, + 'startMinimized': { value: false, type: Setting.TYPE_BOOL, public: true, appTypes: ['desktop'], label: () => _('Start application minimised in the tray icon') }, + 'collapsedFolderIds': { value: [], type: Setting.TYPE_ARRAY, public: false }, 'encryption.enabled': { value: false, type: Setting.TYPE_BOOL, public: false },