add error exception to postToastSwitch

pull/78/head
Aevann1 2022-12-16 22:00:42 +02:00
parent 2eaa72b4e8
commit 760c4f7ae0
1 changed files with 5 additions and 2 deletions

View File

@ -98,8 +98,11 @@ function postToastSwitch(t, url, button1, button2, cls, extraActionsOnSuccess, m
if (typeof(button1) == 'boolean') {
location.reload()
} else {
document.getElementById(button1).classList.toggle(cls);
document.getElementById(button2).classList.toggle(cls);
try {
document.getElementById(button1).classList.toggle(cls);
document.getElementById(button2).classList.toggle(cls);
}
catch (e) {}
}
}
if (extraActionsOnSuccess) extraActionsOnSuccess(xhr);