Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Allow timeout: false to remove a timeout" #284

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
22 changes: 0 additions & 22 deletions test/terminal-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down