Promisify gui.notify. Will not run it synchronously, but is nice to have.
This commit is contained in:
parent
f015a6f2c5
commit
8ddc6e5a20
|
@ -37,15 +37,22 @@ gui.counterUpdate = function (which, raw) {
|
||||||
};
|
};
|
||||||
gui.notify = function (title, message) {
|
gui.notify = function (title, message) {
|
||||||
'use strict';
|
'use strict';
|
||||||
notifier.notify({
|
return new Promise((resolve, reject) => {
|
||||||
title: title,
|
notifier.notify({
|
||||||
message: message,
|
title: title,
|
||||||
//icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
|
message: message,
|
||||||
sound: true, // Only Notification Center or Windows Toasters
|
//icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
|
||||||
wait: true // Wait with callback, until user action is taken against notification
|
sound: true, // Only Notification Center or Windows Toasters
|
||||||
}, function (err, response) {
|
wait: true // Wait with callback, until user action is taken against notification
|
||||||
// Response is response from notification
|
}, function (err, response) {
|
||||||
});
|
// Response is response from notification
|
||||||
|
if (err) {
|
||||||
|
log.error(`Error with notification`, err);
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
return resolve(true);
|
||||||
|
});
|
||||||
|
})
|
||||||
};
|
};
|
||||||
gui.updateCam = function (t) {
|
gui.updateCam = function (t) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
Loading…
Reference in New Issue