File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -449,8 +449,12 @@ export default {
449
449
450
450
watch: {
451
451
loadingMessages (val ) {
452
- if (val) this .infiniteState = null
453
- else this .focusTextarea (true )
452
+ if (val) {
453
+ this .infiniteState = null
454
+ } else {
455
+ if (this .infiniteState ) this .infiniteState .loaded ()
456
+ this .focusTextarea (true )
457
+ }
454
458
},
455
459
room (newVal , oldVal ) {
456
460
if (newVal .roomId && newVal .roomId !== oldVal .roomId ) {
@@ -543,18 +547,18 @@ export default {
543
547
const element = this .$refs .scrollContainer
544
548
if (! element) return
545
549
550
+ unwatch ()
551
+
546
552
setTimeout (() => {
547
553
element .scrollTo ({ top: element .scrollHeight })
548
- unwatch ()
549
- }, 0 )
554
+ this . loadingMessages = false
555
+ })
550
556
}
551
557
)
552
558
},
553
559
onMessageAdded ({ message, index }) {
554
560
this .newMessages = []
555
561
556
- this .loadingMessages = false
557
-
558
562
if (index !== this .messages .length - 1 ) return
559
563
560
564
setTimeout (() => {
@@ -800,6 +804,11 @@ export default {
800
804
this .resetMessage (true )
801
805
},
802
806
loadMoreMessages (infiniteState ) {
807
+ if (this .loadingMessages ) {
808
+ this .infiniteState = infiniteState
809
+ return
810
+ }
811
+
803
812
setTimeout (
804
813
() => {
805
814
if (this .loadingMoreMessages ) return
You can’t perform that action at this time.
0 commit comments