From 55678685dce1a22b63713460017231d137fba024 Mon Sep 17 00:00:00 2001 From: "xujingli.xjl" Date: Wed, 4 Sep 2024 19:25:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20umi=E7=89=88=E6=9C=AC=E8=BE=83=E4=BD=8E?= =?UTF-8?q?=E6=97=B6=E6=B5=81=E5=A4=B1=E8=BE=93=E5=87=BA=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-apps/platform/src/modules/chat/chat.ts | 12 ++++++++++-- web-apps/ui/package.json | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web-apps/platform/src/modules/chat/chat.ts b/web-apps/platform/src/modules/chat/chat.ts index dcc9c1d..8ffade9 100644 --- a/web-apps/platform/src/modules/chat/chat.ts +++ b/web-apps/platform/src/modules/chat/chat.ts @@ -232,7 +232,11 @@ export class Chat extends AsyncModel { const newMessageModel: ChatMessageModel = JSON.parse(e.data); const message = this.getOrCreateMessage(newMessageModel); this.messages = [...this.messages, message]; - setImmediate(() => this.scrollToBottom(true, false)); + setImmediate(() => { + if (!this.showToBottomBtn) { + this.scrollToBottom(true, false); + } + }); } if (e.event === 'chunk') { @@ -241,7 +245,11 @@ export class Chat extends AsyncModel { if (msg) { this.processingChunk = msg; msg.appendChunk(chunk); - setImmediate(() => this.scrollToBottom(true, false)); + setImmediate(() => { + if (!this.showToBottomBtn) { + this.scrollToBottom(true, false); + } + }); } } } catch (e) { diff --git a/web-apps/ui/package.json b/web-apps/ui/package.json index 602c95d..b5e98cc 100644 --- a/web-apps/ui/package.json +++ b/web-apps/ui/package.json @@ -48,7 +48,7 @@ "remark-breaks": "^4.0.0", "remark-gfm": "^4.0.0", "timeago.js": "^4.0.2", - "umi": "^4.1.1" + "umi": "^4.3.18" }, "devDependencies": { "@babel/plugin-proposal-decorators": "^7.23.7",