1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

refactor(appjs): no need to check if always present elements are always present

This commit is contained in:
jvoisin 2025-06-20 14:51:48 +02:00 committed by Frédéric Guillot
parent 92876a0c61
commit 93b17af78b

View file

@ -147,9 +147,7 @@ function handleSubmitButtons() {
// Show modal dialog with the list of keyboard shortcuts. // Show modal dialog with the list of keyboard shortcuts.
function showKeyboardShortcuts() { function showKeyboardShortcuts() {
const template = document.getElementById("keyboard-shortcuts"); const template = document.getElementById("keyboard-shortcuts");
if (template !== null) { ModalHandler.open(template.content, "dialog-title");
ModalHandler.open(template.content, "dialog-title");
}
} }
// Mark as read visible items of the current page. // Mark as read visible items of the current page.
@ -694,18 +692,14 @@ function showToast(label, iconElement) {
} }
const toastMsgElement = document.getElementById("toast-msg"); const toastMsgElement = document.getElementById("toast-msg");
if (toastMsgElement) { toastMsgElement.replaceChildren(iconElement.content.cloneNode(true));
toastMsgElement.replaceChildren(iconElement.content.cloneNode(true)); appendIconLabel(toastMsgElement, label);
appendIconLabel(toastMsgElement, label);
const toastElementWrapper = document.getElementById("toast-wrapper"); const toastElementWrapper = document.getElementById("toast-wrapper");
if (toastElementWrapper) { toastElementWrapper.classList.remove('toast-animate');
toastElementWrapper.classList.remove('toast-animate'); setTimeout(() => {
setTimeout(() => { toastElementWrapper.classList.add('toast-animate');
toastElementWrapper.classList.add('toast-animate'); }, 100);
}, 100);
}
}
} }
/** Navigate to the new subscription page. */ /** Navigate to the new subscription page. */