perf: 优化iOS出现连续加载消息列表的情况

This commit is contained in:
kuaifan 2023-06-19 11:33:41 +08:00
parent 7ad8abce6b
commit 5dddf25e5e

View File

@ -1074,7 +1074,16 @@ export default {
allMsgList(newList, oldList) {
const {tail} = this.scrollInfo();
this.allMsgs = newList;
if ($A.isIos() && newList.length !== oldList.length) {
// iOS
this.$refs.scroller.$el.style.visibility = 'hidden'
this.allMsgs = newList;
this.$nextTick(_ => {
this.$refs.scroller.$el.style.visibility = 'visible'
})
} else {
this.allMsgs = newList;
}
//
if (!this.windowActive || (tail > 10 && oldList.length > 0)) {
const lastId = oldList[oldList.length - 1] ? oldList[oldList.length - 1].id : 0