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 {
449449
450450 watch: {
451451 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+ }
454458 },
455459 room (newVal , oldVal ) {
456460 if (newVal .roomId && newVal .roomId !== oldVal .roomId ) {
@@ -543,18 +547,18 @@ export default {
543547 const element = this .$refs .scrollContainer
544548 if (! element) return
545549
550+ unwatch ()
551+
546552 setTimeout (() => {
547553 element .scrollTo ({ top: element .scrollHeight })
548- unwatch ()
549- }, 0 )
554+ this . loadingMessages = false
555+ })
550556 }
551557 )
552558 },
553559 onMessageAdded ({ message, index }) {
554560 this .newMessages = []
555561
556- this .loadingMessages = false
557-
558562 if (index !== this .messages .length - 1 ) return
559563
560564 setTimeout (() => {
@@ -800,6 +804,11 @@ export default {
800804 this .resetMessage (true )
801805 },
802806 loadMoreMessages (infiniteState ) {
807+ if (this .loadingMessages ) {
808+ this .infiniteState = infiniteState
809+ return
810+ }
811+
803812 setTimeout (
804813 () => {
805814 if (this .loadingMoreMessages ) return
You can’t perform that action at this time.
0 commit comments