[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;
|
||||
const data = await res.json();
|
||||
const cfg = data.settings || {};
|
||||
document.querySelector('[name="welcomeChannelId"]').value = cfg.welcomeChannelId || '';
|
||||
document.querySelector('[name="logChannelId"]').value = cfg.logChannelId || '';
|
||||
document.querySelector('[name="supportRoleId"]').value = cfg.supportRoleId || '';
|
||||
const welcomeChannelInput = document.querySelector('input[name="welcomeChannelId"]');
|
||||
const logChannelInput = document.querySelector('input[name="logChannelId"]');
|
||||
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;
|
||||
modulesCache['ticketsEnabled'] = cfg.ticketsEnabled !== false;
|
||||
modulesCache['automodEnabled'] = cfg.automodEnabled !== false;
|
||||
|
||||
Reference in New Issue
Block a user