add notification fallback to use Notify.show()

cpsdqs/unified-input
Ondřej Hruška 7 years ago
parent 2921566cc3
commit 2b3a5b4b55
  1. 3
      jssrc/term_screen.js

@ -910,6 +910,7 @@ class TermScreen {
} }
showNotification (text) { showNotification (text) {
console.log(`Notification: ${text}`);
// TODO: request permission earlier // TODO: request permission earlier
// the requestPermission should be user-triggered; asking upfront seems // the requestPermission should be user-triggered; asking upfront seems
// a little awkward // a little awkward
@ -918,6 +919,8 @@ class TermScreen {
body: text body: text
}); });
notification.addEventListener('click', () => window.focus()); notification.addEventListener('click', () => window.focus());
} else {
Notify.show(text);
} }
} }

Loading…
Cancel
Save