Skip to content

Commit

Permalink
(fix) new message divider reset
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine92190 committed Mar 17, 2021
1 parent 7bfd345 commit 453bacc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ChatWindow/Room/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ export default {
if (val) this.message = this.roomMessage
}
},
messages(val) {
val.forEach((message, i) => {
messages(newVal, oldVal) {
newVal.forEach((message, i) => {
if (
this.showNewMessagesDivider &&
!message.seen &&
Expand All @@ -490,6 +490,10 @@ export default {
}
})
if (oldVal?.length === newVal?.length - 1) {
this.newMessages = []
}
if (this.infiniteState) {
this.infiniteState.loaded()
}
Expand Down Expand Up @@ -566,8 +570,6 @@ export default {
)
},
onMessageAdded({ message, index, ref }) {
this.newMessages = []
if (index !== this.messages.length - 1) return
const autoScrollOffset = ref.offsetHeight + 60
Expand Down

0 comments on commit 453bacc

Please sign in to comment.