mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
Sanity check before settings are saved #655 ⚙
This commit is contained in:
Regular → Executable
Regular → Executable
@@ -753,6 +753,21 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
}
|
||||
});
|
||||
|
||||
// console.log(settingsArray);
|
||||
|
||||
// sanity check to make sure settings were loaded & collected correctly
|
||||
sanityCheck_notOK = true
|
||||
$.each(settingsArray, function(index, value) {
|
||||
// Do something with each element of the array
|
||||
if(value[1] == "UI_LANG")
|
||||
{
|
||||
sanityCheck_notOK = isEmpty(value[3])
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(sanityCheck_notOK == false)
|
||||
{
|
||||
// trigger a save settings event in the backend
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
@@ -772,6 +787,9 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
|
||||
}
|
||||
});
|
||||
} else{
|
||||
showModalOk('WARNING', "<?= lang("settings_missing_block")?>");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user