Skip to content

Commit

Permalink
Fixed channel selector in bot/dashboard/_/notification/_
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <[email protected]>
  • Loading branch information
dssecret committed Mar 8, 2025
1 parent d16744f commit 9111587
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions application/static/bot/update-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,20 @@ ready(() => {
channelInput = document.getElementById("notification-channel");
resourceIDInput = document.getElementById("notification-resource-id");

channelsPromise.then(() => {
new TomSelect(".discord-channel-selector", {
create: false,
channelsPromise
.then(() => {
const channelOption = channelInput.querySelector(`option[value=${channel_id}"]`);

if (channelOption != null) {
channelOption.attr("selected", "");
}
})
.finally(() => {
new TomSelect(".discord-channel-selector", {
create: false,
});
});

const channelOption = $(`#notification-channel option[value="${channel_id}"]`);
if (channelOption.length !== 0) {
channelOption.attr("selected", "");
}
});

document.getElementById("setup-trigger").addEventListener("click", setupTrigger);
document.getElementById("delete-notification").addEventListener("click", deleteNotification);
document.getElementById("notification-toggle-enable").addEventListener("click", toggleNotification);
Expand Down

0 comments on commit 9111587

Please sign in to comment.