mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
fix(chat): fix type error and indentation in reconnect/scroll-lock change
- useChat.ts reconnectStream: cast the reused assistant message id to string when calling updateMessage; the id is optional in the Message type, so the raw value broke the vue-tsc build (TS2345, undefined not assignable). - useStickToBottom.ts handleScroll: restore the block's indentation (it had drifted to 1/3-space) and add a comment for the scroll-up release branch. Verified: vue-tsc --noEmit passes; snowflake precision check clean.
This commit is contained in:
parent
65f6a8c6b2
commit
20b8b63320
@ -2060,7 +2060,7 @@ export function useChat(options: UseChatOptions): UseChatReturn {
|
||||
&& (m.status === 'generating' || m.status === 'awaiting_approval')
|
||||
)
|
||||
if (existingAsst) {
|
||||
updateMessage(existingAsst.id, {
|
||||
updateMessage(existingAsst.id as string, {
|
||||
...existingAsst,
|
||||
content: '',
|
||||
contentParts: [],
|
||||
|
||||
@ -127,9 +127,11 @@ export function useStickToBottom(
|
||||
}
|
||||
|
||||
// 处理滚动事件
|
||||
const handleScroll = () => {
|
||||
if (!scrollRef.value) return
|
||||
if (isScrolling) {
|
||||
const handleScroll = () => {
|
||||
if (!scrollRef.value) return
|
||||
if (isScrolling) {
|
||||
// User scrolled up during a programmatic scroll — release the lock so the
|
||||
// view stops snapping back to the bottom.
|
||||
const currentScrollTop = scrollRef.value.scrollTop
|
||||
if (currentScrollTop < lastScrollTop) {
|
||||
isScrolling = false
|
||||
@ -138,7 +140,7 @@ export function useStickToBottom(
|
||||
}
|
||||
lastScrollTop = scrollRef.value.scrollTop
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const element = scrollRef.value
|
||||
const currentScrollTop = element.scrollTop
|
||||
|
||||
Loading…
Reference in New Issue
Block a user