diff options
author | 2020-04-10 12:41:22 +0530 | |
---|---|---|
committer | 2020-04-10 08:11:22 +0100 | |
commit | 212f29c5d7ce15cf205adcd17063258b0be306ff (patch) | |
tree | 9ef4406d57243675892f2bced4b4a87d229627e5 /src/stores | |
parent | Minor spelling fixes in README (#552) (diff) | |
download | ferdium-app-212f29c5d7ce15cf205adcd17063258b0be306ff.tar.gz ferdium-app-212f29c5d7ce15cf205adcd17063258b0be306ff.tar.zst ferdium-app-212f29c5d7ce15cf205adcd17063258b0be306ff.zip |
Add notification & audio toggle action in tray context menu (#542)
* feat: Add new tray menu item to enable / disable Notifications and Audio
- Use ipcMain to listen to iniital App Settings which determines the current isAppMuted state and display menu item text accordingly
- Use ipcMain to listen to updates to App Settings -> isAppMuted from the App Menu / Side Bar and display menu item text accordingly
- When the user clicks on the Enable / Disable Notifications & Audio menu item in the Tray, pass a message to the app via window.webContents.send with channel 'muteApp'
- In stores/AppStore.js, use an ipcRenderer to toggleMuteApp()
- To get the initial app state to the main process, pass a channel 'initialAppSettings' from SettingsStore which the tray class can listen to.
* feat - System Tray menu item for Muting App
- Fix lint errors
* feat: Provide a menu item in the tray bar icon to Mute/Unmute the application
- Revert package-lock.json to the previous commit.
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 4 | ||||
-rw-r--r-- | src/stores/SettingsStore.js | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 593bf341e..c8adb9c3c 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -179,6 +179,10 @@ export default class AppStore extends Store { | |||
179 | this.stores.router.push(url); | 179 | this.stores.router.push(url); |
180 | }); | 180 | }); |
181 | 181 | ||
182 | ipcRenderer.on('muteApp', () => { | ||
183 | this._toggleMuteApp(); | ||
184 | }); | ||
185 | |||
182 | this.locale = this._getDefaultLocale(); | 186 | this.locale = this._getDefaultLocale(); |
183 | 187 | ||
184 | setTimeout(() => { | 188 | setTimeout(() => { |
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 799ba3f5a..227eb2145 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js | |||
@@ -110,6 +110,7 @@ export default class SettingsStore extends Store { | |||
110 | } | 110 | } |
111 | debug('Get appSettings resolves', resp.type, resp.data); | 111 | debug('Get appSettings resolves', resp.type, resp.data); |
112 | Object.assign(this._fileSystemSettingsCache[resp.type], resp.data); | 112 | Object.assign(this._fileSystemSettingsCache[resp.type], resp.data); |
113 | ipcRenderer.send('initialAppSettings', resp); | ||
113 | }); | 114 | }); |
114 | 115 | ||
115 | this.fileSystemSettingsTypes.forEach((type) => { | 116 | this.fileSystemSettingsTypes.forEach((type) => { |