fix query selector when checkbox is missing

This commit is contained in:
Eric Espie
2026-02-06 11:39:20 +01:00
parent c11fd6e348
commit 24110bd880

View File

@@ -86,7 +86,10 @@ class IboDashboard extends HTMLElement {
this.setAttribute("data-custom-dashboard", bIsCustom ? "true" : "false");
SetUserPreference(`display_original_dashboard_${this.sId}`, !bIsCustom, true);
console.log(document.querySelector('.ibo-dashboard--selector[data-dashboard-id="'+this.sId+'"] input[type="checkbox"]'));
document.querySelector('.ibo-dashboard--selector[data-dashboard-id="'+this.sId+'"] input[type="checkbox"]').checked = bIsCustom;
let checkbox = document.querySelector('.ibo-dashboard--selector[data-dashboard-id="'+this.sId+'"] input[type="checkbox"]');
if (checkbox) {
checkbox.checked = bIsCustom;
}
return this.ReloadFromBackend(bIsCustom);
}