Fix settings not saving if overflow category not saving

This commit is contained in:
rxdn 2022-06-01 18:13:48 +01:00
parent 702e9be96d
commit 698d9d2965

View File

@ -151,6 +151,11 @@
function showValidations(data) {
let success = true;
if (data.error !== null) {
success = false;
notify("Warning", data.error);
}
if (!data.prefix) {
success = false;
notify("Warning", "Your prefix has not been saved.\nPrefixes must be between 1 - 8 characters in length.")
@ -214,6 +219,10 @@
if (data.overflow_category_id === null) {
data.overflow_category_id = "-2";
}
if (!channels.some((c) => c.id === data.overflow_category_id)) {
data.overflow_category_id = "-2";
}
}
}