File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export default {
94
94
perPage: 20 ,
95
95
rooms: [],
96
96
loadingRooms: true ,
97
+ selectedRoom: null ,
97
98
messages: [],
98
99
messagesLoaded: false ,
99
100
start: null ,
@@ -295,7 +296,11 @@ export default {
295
296
296
297
if (this .start ) query = query .startAfter (this .start )
297
298
299
+ this .selectedRoom = room .roomId
300
+
298
301
query .get ().then (messages => {
302
+ if (this .selectedRoom !== room .roomId ) return
303
+
299
304
if (messages .empty ) this .messagesLoaded = true
300
305
301
306
if (this .start ) this .end = this .start
@@ -306,6 +311,8 @@ export default {
306
311
if (this .start ) listenerQuery = listenerQuery .startAfter (this .start )
307
312
if (this .end ) listenerQuery = listenerQuery .endAt (this .end )
308
313
314
+ if (options .reset ) this .messages = []
315
+
309
316
messages .forEach (message => {
310
317
const formattedMessage = this .formatMessage (room, message)
311
318
this .messages .unshift (formattedMessage)
You can’t perform that action at this time.
0 commit comments