refactor: Notification will now be displayed using system if available.

This commit is contained in:
Quentin Decaunes 2019-08-18 12:36:44 +02:00
parent b967b36a62
commit ebec1d047a

View File

@ -228,12 +228,26 @@ function isWindows() {
*/ */
function notification(type, message) { function notification(type, message) {
appendLog(`notification(): ${type}\n${message}`); appendLog(`notification(): ${type}\n${message}`);
UIkit.notification({
message: (''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>'), if (window.last_notification) {
status: type, window.last_notification.close();
pos: 'top-right', window.last_notification = false;
timeout: 5000 }
window.last_notification = new Notification('Ryzen Controller', {
body: message,
requireInteraction: false,
silent: true,
}); });
if (!window.last_notification) {
window.last_notification = false;
UIkit.notification({
message: (''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>'),
status: type,
pos: 'top-right',
timeout: 5000,
});
}
} }
/** /**