diff options
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/app-visibility.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/app/lib/app-visibility.js b/app/lib/app-visibility.js deleted file mode 100644 index d599f6941b..0000000000 --- a/app/lib/app-visibility.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import { ipcRenderer } from 'electron'; - -type EventHandler = (boolean) => any; - -export default class AppVisiblityObserver { - _handler: EventHandler; - - constructor(handler: EventHandler) { - this._handler = handler; - - ipcRenderer.on('show-window', this._handleShowEvent).on('hide-window', this._handleHideEvent); - } - - dispose() { - ipcRenderer - .removeListener('show-window', this._handleShowEvent) - .removeListener('hide-window', this._handleHideEvent); - } - - _handleShowEvent = (_event) => { - this._handler(true); - }; - - _handleHideEvent = (_event) => { - this._handler(false); - }; -} |
