mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 10:03:28 +07:00
refactor: Notification will now be displayed using system if available.
This commit is contained in:
parent
b967b36a62
commit
ebec1d047a
@ -228,12 +228,26 @@ function isWindows() {
|
||||
*/
|
||||
function notification(type, message) {
|
||||
appendLog(`notification(): ${type}\n${message}`);
|
||||
UIkit.notification({
|
||||
message: (''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>'),
|
||||
status: type,
|
||||
pos: 'top-right',
|
||||
timeout: 5000
|
||||
|
||||
if (window.last_notification) {
|
||||
window.last_notification.close();
|
||||
window.last_notification = false;
|
||||
}
|
||||
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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user