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`.
This commit is contained in:
parent
f0cb041885
commit
35edd8ea92
1 changed files with 2 additions and 1 deletions
|
@ -86,7 +86,8 @@ function onClickMainMenuListItem(event) {
|
||||||
if (element.tagName === "A") {
|
if (element.tagName === "A") {
|
||||||
window.location.href = element.getAttribute("href");
|
window.location.href = element.getAttribute("href");
|
||||||
} else {
|
} else {
|
||||||
window.location.href = element.querySelector("a").getAttribute("href");
|
const linkElement = element.querySelector("a") || element.closest("a");
|
||||||
|
window.location.href = linkElement.getAttribute("href");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue