fix: allow scroll button tap when idle
This commit is contained in:
parent
61aea509bd
commit
b42cb3b032
@ -54,9 +54,16 @@ export function conditionalScrollToBottom(ctx: ScrollContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function toggleScrollLock(ctx: ScrollContext) {
|
export function toggleScrollLock(ctx: ScrollContext) {
|
||||||
const nextState = ctx.chatToggleScrollLockState?.() ?? false;
|
|
||||||
const active = typeof ctx.isOutputActive === 'function' ? ctx.isOutputActive() : true;
|
const active = typeof ctx.isOutputActive === 'function' ? ctx.isOutputActive() : true;
|
||||||
if (nextState && active) {
|
|
||||||
|
// 没有模型输出时:允许点击,但不切换锁定,仅单次滚动到底部
|
||||||
|
if (!active) {
|
||||||
|
scrollToBottom(ctx);
|
||||||
|
return ctx.autoScrollEnabled ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextState = ctx.chatToggleScrollLockState?.() ?? false;
|
||||||
|
if (nextState) {
|
||||||
scrollToBottom(ctx);
|
scrollToBottom(ctx);
|
||||||
}
|
}
|
||||||
return nextState;
|
return nextState;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user