Fix async bug + fix sent bug

This commit is contained in:
zandercymatics 2024-09-18 12:22:24 -06:00
parent ece672e41e
commit c2ac5a1e9a
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 7 additions and 2 deletions

View file

@ -582,6 +582,8 @@ document.addEventListener('DOMContentLoaded', function() {
dropdown.addEventListener("change", function() {
const reason = dropdown.value;
// Update the UI
updateUserInterface(reason);
if (reason && reason !== "other") {
// If it's not the initial value
if (initialDropdownValue !== dropdown.value || initialEmailValue !== textarea.value) {
@ -596,6 +598,7 @@ document.addEventListener('DOMContentLoaded', function() {
}else {
textarea.value = data.action_needed_email;
}
updateUserInterface(reason);
})
.catch(error => {
console.error("Error action needed email: ", error)
@ -603,8 +606,6 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
// Update the UI
updateUserInterface(reason);
});
modalConfirm.addEventListener("click", () => {

View file

@ -219,7 +219,11 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
</div>
</div>
{% if original_object.action_needed_reason_email %}
<input id="last-sent-email-content" class="display-none" value="{{original_object.action_needed_reason_email}}">
{% else %}
<input id="last-sent-email-content" class="display-none" value="None">
{% endif %}
{% else %}
{{ field.field }}