From 3abbe4d4cd86231331d9a6b4adb9065be85cc31c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 11 Jun 2020 20:05:59 -0500 Subject: [PATCH] decaffeinate notifications --- lib/ui/notifications.coffee | 24 ------------------------ lib/ui/notifications.js | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 lib/ui/notifications.coffee create mode 100644 lib/ui/notifications.js diff --git a/lib/ui/notifications.coffee b/lib/ui/notifications.coffee deleted file mode 100644 index 78dc11ac..00000000 --- a/lib/ui/notifications.coffee +++ /dev/null @@ -1,24 +0,0 @@ -remote = require 'remote' - -module.exports = - # notes: [] - # window: remote.getCurrentWindow() - - activate: -> - # document.addEventListener 'focusin', => - # @clear() - - enabled: -> atom.config.get('julia-client.uiOptions.notifications') - - show: (msg, force) -> - # return unless force or (@enabled() and not document.hasFocus()) - # n = new Notification "Julia Client", - # body: msg - # n.onclick = => - # @window.focus() - # @notes.push(n) - - # clear: -> - # for note in @notes - # note.close() - # @notes = [] diff --git a/lib/ui/notifications.js b/lib/ui/notifications.js new file mode 100644 index 00000000..a5ad595e --- /dev/null +++ b/lib/ui/notifications.js @@ -0,0 +1,32 @@ +'use babel' +import remote from 'remote'; + +export default { + // notes: [], + // window: remote.getCurrentWindow(), + // + activate() { + // document.addEventListener('focusin', () => { + // this.clear(); + // }); + }, + + enabled() { return atom.config.get('julia-client.uiOptions.notifications'); }, + + show(msg, force) { + // if (!force && (!this.enabled() || !!document.hasFocus())) { return; } + // const n = new Notification("Julia Client", + // {body: msg}); + // n.onclick = () => { + // this.window.focus(); + // }; + // this.notes.push(n); + }, + + // clear() { + // for (let note of this.notes) { + // note.close(); + // } + // this.notes = []; + // } +};