Skip to content

fix(ai): remove setCurrentFrame from ImageSlider unmount cleanup - #2550

Merged
Aias00 merged 5 commits into
OtterMind:mainfrom
Aias00:fix/ai-imageslider-unmount-setstate-2541
Aug 28, 2026
Merged

Aias00 merged 5 commits into
OtterMind:mainfrom
Aias00:fix/ai-imageslider-unmount-setstate-2541

Conversation

@Aias00

@Aias00 Aias00 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

The unmount cleanup called setCurrentFrame(0), triggering a React state update on an unmounted component.

Location

src/blocks/AI/components/AIButton/ImageSlider.tsx:79

Fix

Remove setCurrentFrame(0) from the cleanup; keep clearInterval and isPlaying.current = false.

Fixes #2541

🤖 Generated with Claude Code

…erMind#2541)

The unmount cleanup called setCurrentFrame(0), triggering a React state
update on an unmounted component. The reset is unnecessary since the
component is about to disappear. Remove it; keep clearInterval and
isPlaying.current = false.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: liuhy <liuhongyu@apache.org>
@Aias00
Aias00 requested a review from openai0229 as a code owner August 4, 2026 09:42
Copilot AI lite review requested due to automatic review settings August 4, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Aias00
Aias00 requested a review from auenger as a code owner August 26, 2026 05:49

@auenger auenger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已完成独立代码审查。该 PR 仅移除组件卸载 cleanup 中的 setCurrentFrame(0),保留 interval 清理与播放状态复位;重新挂载仍由 useState(0) 初始化。未发现阻塞问题,当前 CI 全绿。PR 目前落后于 main,合并前请按仓库策略同步并重跑 CI。

@Aias00
Aias00 merged commit 800c890 into OtterMind:main Aug 28, 2026
16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(ai): ImageSlider setState in unmount cleanup

4 participants