Update config name for notifications

This commit is contained in:
Mashintime 2023-06-11 10:40:01 -04:00
parent edd53929be
commit 8f308d9adc
3 changed files with 6 additions and 6 deletions

View file

@ -101,7 +101,7 @@ const configDefaultSettings =
"enable_auto_retry" : "False", \ "enable_auto_retry" : "False", \
"tx_delay" : 0, \ "tx_delay" : 0, \
"auto_start": 0, \ "auto_start": 0, \
"notification": 1 \ "enable_sys_notification": 1 \
}'; }';
if (!fs.existsSync(configPath)) { if (!fs.existsSync(configPath)) {

View file

@ -2843,7 +2843,7 @@ function clearUnreadMessages(dxcall) {
//Have the operating system show a notification popup //Have the operating system show a notification popup
function showOsPopUp(title, message) function showOsPopUp(title, message)
{ {
if (config.notification == 0) return; if (config.enable_sys_notification == 0) return;
const NOTIFICATION_TITLE = title; const NOTIFICATION_TITLE = title;
const NOTIFICATION_BODY = message; const NOTIFICATION_BODY = message;
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }); new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY });

View file

@ -390,7 +390,7 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("AutoStartSwitch").checked = false; document.getElementById("AutoStartSwitch").checked = false;
} }
if (config.notification == 1) { if (config.enable_sys_notification == 1) {
document.getElementById("NotificationSwitch").checked = true; document.getElementById("NotificationSwitch").checked = true;
} else { } else {
document.getElementById("NotificationSwitch").checked = false; document.getElementById("NotificationSwitch").checked = false;
@ -1222,9 +1222,9 @@ window.addEventListener("DOMContentLoaded", () => {
//Handle change of Notification settings //Handle change of Notification settings
document.getElementById("NotificationSwitch").addEventListener("click", () => { document.getElementById("NotificationSwitch").addEventListener("click", () => {
if (document.getElementById("NotificationSwitch").checked == true) { if (document.getElementById("NotificationSwitch").checked == true) {
config.notification = 1; config.enable_sys_notification = 1;
} else { } else {
config.notification = 0; config.enable_sys_notification = 0;
} }
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); //fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
FD.saveConfig(config, configPath); FD.saveConfig(config, configPath);
@ -3806,7 +3806,7 @@ function autostart_tnc() {
//Have the operating system show a notification popup //Have the operating system show a notification popup
function showOsPopUp(title, message) function showOsPopUp(title, message)
{ {
if (config.notification == 0) return; if (config.enable_sys_notification == 0) return;
const NOTIFICATION_TITLE = title; const NOTIFICATION_TITLE = title;
const NOTIFICATION_BODY = message; const NOTIFICATION_BODY = message;
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }); new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY });