File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ export default {
257
257
messageReply: null ,
258
258
infiniteState: null ,
259
259
loadingMessages: false ,
260
+ loadingMoreMessages: false ,
260
261
file: null ,
261
262
imageFile: null ,
262
263
imageDimensions: { height: ' 32px' , width: ' 10px' },
@@ -320,6 +321,7 @@ export default {
320
321
321
322
if (this .infiniteState ) {
322
323
this .infiniteState .loaded ()
324
+ setTimeout (() => (this .loadingMoreMessages = false ), 0 )
323
325
} else if (newVal .length ) {
324
326
setTimeout (() => {
325
327
element .scrollTo (options)
@@ -447,11 +449,15 @@ export default {
447
449
this .resetMessage ()
448
450
},
449
451
loadMoreMessages (infiniteState ) {
452
+ if (this .loadingMoreMessages ) return
453
+
450
454
if (this .messagesLoaded || ! this .room .roomId ) {
451
455
return infiniteState .complete ()
452
456
}
457
+
453
458
this .infiniteState = infiniteState
454
459
this .$emit (' fetchMessages' )
460
+ this .loadingMoreMessages = true
455
461
},
456
462
messageActionHandler ({ action, message }) {
457
463
switch (action .name ) {
You can’t perform that action at this time.
0 commit comments