From 5c48dc830ee26192f129e3f819dc42df5e569a3a Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Mon, 19 Aug 2019 11:03:21 +0200 Subject: [PATCH] Revert "Allow timeout: false to remove a timeout" --- README.md | 6 +++++- lib/utils.js | 8 -------- test/terminal-notifier.js | 22 ---------------------- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 038ecb8..9984361 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,11 @@ notifier.notify( **Note:** The `wait` option is shorthand for `timeout: 5`. This just sets a timeout for 5 seconds. It does _not_ make the notification sticky! -As of 5.4.0, `timeout` defaults to `10`. In order to have a "fire and forgotten" notification, you need to set `timeout` to `false`. +Without `wait` or `timeout`, notifications are just fired and forgotten. They don't +wait for any response. + +To make notifications wait for a response (like activation/click), you must define +a `timeout`. _Exception:_ If `reply` is defined, it's recommended to set `timeout` to a either high value, or to nothing at all. diff --git a/lib/utils.js b/lib/utils.js index 330c8ff..7c75f29 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -210,14 +210,6 @@ module.exports.mapToMac = function(options) { delete options.wait; } - if (!options.wait && !options.timeout) { - if (options.timeout === false) { - delete options.timeout; - } else { - options.timeout = 10; - } - } - options.json = true; return options; }; diff --git a/test/terminal-notifier.js b/test/terminal-notifier.js index bb5cecb..056bf58 100644 --- a/test/terminal-notifier.js +++ b/test/terminal-notifier.js @@ -277,28 +277,6 @@ describe('terminal-notifier', function() { }); }); - it('should not set a default timeout if explicitly false', function(done) { - var expected = [ - '-title', - '"Title"', - '-message', - '"Message"', - '-json', - '"true"' - ]; - - expectArgsListToBe(expected, done); - var notifier = new NotificationCenter(); - notifier.isNotifyChecked = true; - notifier.hasNotifier = true; - - notifier.notify({ - title: 'Title', - message: 'Message', - timeout: false - }); - }); - it('should escape all title and message', function(done) { var expected = [ '-title',