Skip to content

Commit 06a4e49

Browse files
committed
enhance: option.timeout = 0 enables persistent parameter
1 parent b81d324 commit 06a4e49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/utils.js

+10
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ module.exports.mapToWin8 = function (options) {
434434
delete options.sound;
435435
}
436436

437+
/*
438+
Wait, sticky are aliases for persistent.
439+
*/
440+
437441
if (options.wait === true || options.sticky === true) {
438442
options.persistent = true;
439443
delete options.wait;
@@ -444,11 +448,17 @@ module.exports.mapToWin8 = function (options) {
444448
-d (duration) flag for ntfytoast
445449
must be one of two options:
446450
-d short | long
451+
452+
short : 7 seconds
453+
long : 25 seconds
447454
*/
448455

449456
if (options.timeout) {
450457
if (options.timeout === 'long' || (typeof options.timeout === 'number' && options.timeout > 7)) {
451458
options.d = 'long';
459+
} else if (typeof options.timeout === 'number' && options.timeout === 0) {
460+
options.persistent = true;
461+
delete options.timeout;
452462
} else {
453463
options.d = 'short';
454464
}

0 commit comments

Comments
 (0)