How to use the node-notifier.once function in node-notifier

To help you get started, we’ve selected a few node-notifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emsk / redmine-notifier / app / index.js View on Github external
return this;
      }

      this._mostRecentIssueId = issues[0].id;
      notifierScreen.setNotificationIcon(this._index);

      // Display the latest issue's subject only
      nodeNotifier.notify({
        title: this.buildNotificationTitle(issueCount, isOverPage),
        message: issues[0].subject,
        wait: true
      });

      nodeNotifier.removeAllListeners();

      nodeNotifier.once('click', () => {
        shell.openExternal(`${this._settings.url}/issues/${this._mostRecentIssueId}`);
        notifierScreen.setNormalIcon();
        nodeNotifier.removeAllListeners();
      });

      nodeNotifier.once('timeout', () => {
        nodeNotifier.removeAllListeners();
      });

      return this;
    }
github emsk / redmine-notifier / app / index.js View on Github external
// Display the latest issue's subject only
      nodeNotifier.notify({
        title: this.buildNotificationTitle(issueCount, isOverPage),
        message: issues[0].subject,
        wait: true
      });

      nodeNotifier.removeAllListeners();

      nodeNotifier.once('click', () => {
        shell.openExternal(`${this._settings.url}/issues/${this._mostRecentIssueId}`);
        notifierScreen.setNormalIcon();
        nodeNotifier.removeAllListeners();
      });

      nodeNotifier.once('timeout', () => {
        nodeNotifier.removeAllListeners();
      });

      return this;
    }
github codex-team / codex.notes / src / controllers / pushNotifications.js View on Github external
let notifierOption = {
      appIcon : this.icon,
      title   : options.title || this.title,
      subtitle : options.subtitle,
      contentImage : options.image,
      message : options.message,

      timeout : 10
    };

    if ( callbacks.length > 0 ) {
      notifierOption.wait = true;
    }

    if ( typeof callbacks['click'] === 'function' ) {
      notifier.once('click', callbacks['click']);
    }

    notifier.notify(notifierOption);
  }
}