[deploy] Guard settings inputs in dashboard loadSettings
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s
This commit is contained in:
@@ -1757,9 +1757,12 @@ router.get('/', (req, res) => {
|
|||||||
if (!res.ok) return;
|
if (!res.ok) return;
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
const cfg = data.settings || {};
|
const cfg = data.settings || {};
|
||||||
document.querySelector('[name="welcomeChannelId"]').value = cfg.welcomeChannelId || '';
|
const welcomeChannelInput = document.querySelector('input[name="welcomeChannelId"]');
|
||||||
document.querySelector('[name="logChannelId"]').value = cfg.logChannelId || '';
|
const logChannelInput = document.querySelector('input[name="logChannelId"]');
|
||||||
document.querySelector('[name="supportRoleId"]').value = cfg.supportRoleId || '';
|
const supportRoleInput = document.querySelector('input[name="supportRoleId"]');
|
||||||
|
if (welcomeChannelInput) (welcomeChannelInput as HTMLInputElement).value = cfg.welcomeChannelId || '';
|
||||||
|
if (logChannelInput) (logChannelInput as HTMLInputElement).value = cfg.logChannelId || '';
|
||||||
|
if (supportRoleInput) (supportRoleInput as HTMLInputElement).value = cfg.supportRoleId || '';
|
||||||
automodConfigCache = cfg;
|
automodConfigCache = cfg;
|
||||||
modulesCache['ticketsEnabled'] = cfg.ticketsEnabled !== false;
|
modulesCache['ticketsEnabled'] = cfg.ticketsEnabled !== false;
|
||||||
modulesCache['automodEnabled'] = cfg.automodEnabled !== false;
|
modulesCache['automodEnabled'] = cfg.automodEnabled !== false;
|
||||||
|
|||||||
Reference in New Issue
Block a user