notification.js 429 B

1234567891011121314151617181920
  1. 'use strict';
  2. const electron = require('electron');
  3. const localfs = require('../lib/localfs');
  4. let showNotification = function (title, body, silent) {
  5. const notification = new electron.Notification({
  6. title: title,
  7. body: body,
  8. icon: localfs.getPackageIconPath('AriaNg.ico'),
  9. silent: !!silent
  10. });
  11. notification.show();
  12. };
  13. module.exports = {
  14. showNotification: showNotification
  15. };