aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Michael Kuhn <github@ikkoku.de> 2024-04-08 23:40:58 +0200
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-04-09 20:36:42 -0700
commit35edd8ea92477618fa8e6de2de38b1ca4981eace (patch)
tree64349385addbf191bc5adc748cdd043ed4893749
parentf0cb04188588531eb24f56ebfa79f9f05cda8dc3 (diff)
downloadv2-35edd8ea92477618fa8e6de2de38b1ca4981eace.tar.gz
v2-35edd8ea92477618fa8e6de2de38b1ca4981eace.tar.zst
v2-35edd8ea92477618fa8e6de2de38b1ca4981eace.zip
Fix clicking unread counter
When clicking the unread counter, the following exception occurs: ``` Uncaught TypeError: Cannot read properties of null (reading 'getAttribute') ``` This is due to `onClickMainMenuListItem` not working correctly for the unread counter `span`s, which return `null` when using `querySelector`.
-rw-r--r--internal/ui/static/js/app.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js
index 79ffb4b5..02911194 100644
--- a/internal/ui/static/js/app.js
+++ b/internal/ui/static/js/app.js
@@ -86,7 +86,8 @@ function onClickMainMenuListItem(event) {
if (element.tagName === "A") {
window.location.href = element.getAttribute("href");
} else {
- window.location.href = element.querySelector("a").getAttribute("href");
+ const linkElement = element.querySelector("a") || element.closest("a");
+ window.location.href = linkElement.getAttribute("href");
}
}