From e325698899e11af85694f437dbe8d6950e7a28ae Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 1 May 2024 10:52:52 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20ipad=20=E5=8F=91=E9=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=90=8E=E5=87=BA=E7=8E=B0=E9=A1=B5=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/pages/manage/messenger.vue | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue index 7cc76fafc..510c6274b 100644 --- a/resources/assets/js/pages/manage/messenger.vue +++ b/resources/assets/js/pages/manage/messenger.vue @@ -951,23 +951,27 @@ export default { }, scrollIntoActive() { + if (this.windowPortrait || this.windowScrollY > 0) { + return; + } this.$nextTick(() => { - if (this.windowLandscape && this.$refs.list) { - const active = this.$refs.list.querySelector(".active") - if (active) { - $A.scrollIntoViewIfNeeded(active); - } else { - const dialog = this.cacheDialogs.find(({id}) => id == this.dialogId) - if (dialog && this.dialogActive) { - this.dialogActive = ''; - this.$nextTick(() => { - const active = this.$refs.list.querySelector(".active") - if (active) { - $A.scrollIntoViewIfNeeded(active); - } - }); + if (!this.$refs.list) { + return; + } + const active = this.$refs.list.querySelector(".active") + if (active) { + $A.scrollIntoViewIfNeeded(active); + return; + } + const dialog = this.cacheDialogs.find(({id}) => id == this.dialogId) + if (dialog && this.dialogActive) { + this.dialogActive = ''; + this.$nextTick(() => { + const active = this.$refs.list.querySelector(".active") + if (active) { + $A.scrollIntoViewIfNeeded(active); } - } + }); } }) },