Fix null reference in toggle entry attachments shortcut

Fixes #1723
This commit is contained in:
Frédéric Guillot 2023-03-13 20:13:10 -07:00
parent ea8c3c801a
commit 9ae6922bdc

View file

@ -35,7 +35,12 @@ document.addEventListener("DOMContentLoaded", function () {
keyboardHandler.on("+", () => goToAddSubscription()); keyboardHandler.on("+", () => goToAddSubscription());
keyboardHandler.on("#", () => unsubscribeFromFeed()); keyboardHandler.on("#", () => unsubscribeFromFeed());
keyboardHandler.on("/", (e) => setFocusToSearchInput(e)); keyboardHandler.on("/", (e) => setFocusToSearchInput(e));
keyboardHandler.on("a", () => document.querySelector('.entry-enclosures').toggleAttribute('open')); keyboardHandler.on("a", () => {
let enclosureElement = document.querySelector('.entry-enclosures');
if (enclosureElement) {
enclosureElement.toggleAttribute('open');
}
});
keyboardHandler.on("Escape", () => ModalHandler.close()); keyboardHandler.on("Escape", () => ModalHandler.close());
keyboardHandler.listen(); keyboardHandler.listen();
} }