Don't toggle drawer if elements not found

732ca6c4e0ea72862034c3738af8ec6117495042

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -0Ignore whitespace
public/scripts/utils.js+5 -0
@@ -2157,6 +2157,11 @@ export function toggleDrawer(drawer, expand = true) {
2157 /** @type {HTMLElement} */2157 /** @type {HTMLElement} */
2158 const content = drawer.querySelector(':scope > .inline-drawer-content');2158 const content = drawer.querySelector(':scope > .inline-drawer-content');
21592159
2160 if (!icon || !content) {
2161 console.debug('toggleDrawer: No icon or content found in the drawer element.');
2162 return;
2163 }
2164
2160 if (expand) {2165 if (expand) {
2161 icon.classList.remove('down', 'fa-circle-chevron-down');2166 icon.classList.remove('down', 'fa-circle-chevron-down');
2162 icon.classList.add('up', 'fa-circle-chevron-up');2167 icon.classList.add('up', 'fa-circle-chevron-up');