Partially fix reminder usernames resetting
This commit is contained in:
parent
6a94f990cf
commit
77f17c8dc2
@ -66,19 +66,30 @@ function update_select(sel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sel.selectedOptions[0].dataset["webhookAvatar"]) {
|
||||
sel.closest("div.reminderContent").querySelector("img.discord-avatar").src =
|
||||
sel.selectedOptions[0].dataset["webhookAvatar"];
|
||||
} else {
|
||||
sel.closest("div.reminderContent").querySelector("img.discord-avatar").src =
|
||||
"/static/img/icon.png";
|
||||
let isCreating = sel.closest("div.reminderContent").classList.contains("creator");
|
||||
|
||||
if (!isCreating) {
|
||||
return;
|
||||
}
|
||||
if (sel.selectedOptions[0].dataset["webhookName"]) {
|
||||
sel.closest("div.reminderContent").querySelector("input.discord-username").value =
|
||||
sel.selectedOptions[0].dataset["webhookName"];
|
||||
|
||||
const avatarInput = sel
|
||||
.closest("div.reminderContent")
|
||||
.querySelector("img.discord-avatar");
|
||||
|
||||
if (sel.selectedOptions[0].dataset["webhookAvatar"]) {
|
||||
avatarInput.src = sel.selectedOptions[0].dataset["webhookAvatar"];
|
||||
} else {
|
||||
sel.closest("div.reminderContent").querySelector("input.discord-username").value =
|
||||
"Reminder";
|
||||
avatarInput.src = "/static/img/icon.png";
|
||||
}
|
||||
|
||||
const usernameInput = sel
|
||||
.closest("div.reminderContent")
|
||||
.querySelector("input.discord-username");
|
||||
|
||||
if (sel.selectedOptions[0].dataset["webhookName"]) {
|
||||
usernameInput.value = sel.selectedOptions[0].dataset["webhookName"];
|
||||
} else {
|
||||
usernameInput.value = "Reminder";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user