File tree Expand file tree Collapse file tree 2 files changed +32
-30
lines changed Expand file tree Collapse file tree 2 files changed +32
-30
lines changed Original file line number Diff line number Diff line change @@ -509,29 +509,29 @@ export default {
509509 if (val) this .message = this .roomMessage
510510 }
511511 },
512- messages (newVal , oldVal ) {
513- newVal .forEach ((message , i ) => {
514- if (
515- this .showNewMessagesDivider &&
516- ! message .seen &&
517- message .senderId !== this .currentUserId
518- ) {
519- this .newMessages .push ({
520- _id: message ._id ,
521- index: i
522- })
512+ messages: {
513+ deep: true ,
514+ handler (newVal , oldVal ) {
515+ newVal .forEach ((message , i ) => {
516+ if (
517+ this .showNewMessagesDivider &&
518+ ! message .seen &&
519+ message .senderId !== this .currentUserId
520+ ) {
521+ this .newMessages .push ({
522+ _id: message ._id ,
523+ index: i
524+ })
525+ }
526+ })
527+ if (oldVal? .length === newVal? .length - 1 ) {
528+ this .newMessages = []
523529 }
524- })
525-
526- if (oldVal? .length === newVal? .length - 1 ) {
527- this .newMessages = []
528- }
529-
530- if (this .infiniteState ) {
531- this .infiniteState .loaded ()
530+ if (this .infiniteState ) {
531+ this .infiniteState .loaded ()
532+ }
533+ setTimeout (() => (this .loadingMoreMessages = false ))
532534 }
533-
534- setTimeout (() => (this .loadingMoreMessages = false ))
535535 },
536536 messagesLoaded (val ) {
537537 if (val) this .loadingMessages = false
Original file line number Diff line number Diff line change @@ -125,15 +125,17 @@ export default {
125125 },
126126
127127 watch: {
128- rooms (newVal , oldVal ) {
129- this .filteredRooms = newVal
130-
131- if (
132- this .infiniteState &&
133- (newVal .length !== oldVal .length || this .roomsLoaded )
134- ) {
135- this .infiniteState .loaded ()
136- this .loadingMoreRooms = false
128+ rooms: {
129+ deep: true ,
130+ handler (newVal , oldVal ) {
131+ this .filteredRooms = newVal
132+ if (
133+ this .infiniteState &&
134+ (newVal .length !== oldVal .length || this .roomsLoaded )
135+ ) {
136+ this .infiniteState .loaded ()
137+ this .loadingMoreRooms = false
138+ }
137139 }
138140 },
139141 loadingRooms (val ) {
You can’t perform that action at this time.
0 commit comments