summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2023-04-24 11:24:58 +0200
committerGitHub <noreply@github.com>2023-04-24 11:24:58 +0200
commit26f74213b2a04d4c52c4a8e5b1a86c2952a36fb1 (patch)
tree85ccdb31e20a39134c529faac2b62a7a856e195b
parent709927f5a15fcbaf3bb567577848761d176bcc12 (diff)
parentf3c980c77498b213b1eced5f36252d8079757e00 (diff)
Merge pull request #9363 from nextcloud/fix/9335/unread-mentions-error
Fix TypeError at `LeftSidebar`
-rw-r--r--src/components/LeftSidebar/LeftSidebar.vue20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue
index 1558cc09b..3213881c4 100644
--- a/src/components/LeftSidebar/LeftSidebar.vue
+++ b/src/components/LeftSidebar/LeftSidebar.vue
@@ -33,7 +33,7 @@
<NewGroupConversation v-if="canStartConversations" />
</div>
<template #list>
- <li class="left-sidebar__list">
+ <li ref="container" class="left-sidebar__list">
<ul ref="scroller"
class="scroller"
@scroll="debounceHandleScroll">
@@ -556,17 +556,15 @@ export default {
},
handleUnreadMention() {
this.unreadNum = 0
- const unreadMentions = document.getElementsByClassName('unread-mention-conversation')
- if (unreadMentions.length) {
- unreadMentions.forEach(x => {
- if (this.elementIsBelowViewpoint(this.$refs.container, x)) {
- if (this.unreadNum === 0) {
- this.firstUnreadPos = x.offsetTop
- }
- this.unreadNum += 1
+ const unreadMentions = document.querySelectorAll('.unread-mention-conversation')
+ unreadMentions.forEach(x => {
+ if (this.elementIsBelowViewpoint(this.$refs.container, x)) {
+ if (this.unreadNum === 0) {
+ this.firstUnreadPos = x.offsetTop
}
- })
- }
+ this.unreadNum += 1
+ }
+ })
},
debounceHandleScroll: debounce(function() {
this.handleScroll()