Skip to content

Commit

Permalink
fix typehinting
Browse files Browse the repository at this point in the history
  • Loading branch information
mutec committed Nov 3, 2024
1 parent 0b6c350 commit 0f761a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/nodes/qsys-config/qsys-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
return this.name;
},
oneditprepare: function () {
document.getElementById("node-config-input-authentication").addEventListener("change", (event) => {
document.getElementById("node-config-input-authentication")?.addEventListener("change", (event) => {
const field = event.currentTarget;
document.querySelectorAll(`[data-requires="${field.id}"]`).forEach((element) => {
element.style.display = field.checked ? "block" : "none";
Expand Down
6 changes: 3 additions & 3 deletions src/nodes/qsys-config/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ RED.nodes.registerType("qsys-config", {
return this.name;
},
oneditprepare: function () {
document.getElementById("node-config-input-authentication").addEventListener("change", (event) => {
document.getElementById("node-config-input-authentication")?.addEventListener("change", (event) => {
const field: HTMLInputElement = event.currentTarget as HTMLInputElement;

document.querySelectorAll(`[data-requires="${field.id}"]`).forEach((element: HTMLElement) => {
element.style.display = field.checked ? "block" : "none";
document.querySelectorAll(`[data-requires="${field.id}"]`).forEach((element) => {
(element as HTMLElement).style.display = field.checked ? "block" : "none";
});
});
},
Expand Down

0 comments on commit 0f761a4

Please sign in to comment.