Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ dist
*.log
.DS_Store
.agents
.cursor
.cursor


# MARK: You have ignore this
package-lock.json
3 changes: 3 additions & 0 deletions packages/website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# MARK: You have ignore this
package-lock.json
12 changes: 8 additions & 4 deletions packages/website/src/components/terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,16 @@ const markAnimationCompleted = () => {
};

const Terminal = () => {
const [state, setState] = useState<AnimationState>(
didAnimationComplete() ? COMPLETED_STATE : INITIAL_STATE,
);
// #MARK: Before this fix, we read localStorage during render and could start from COMPLETED_STATE on the client.
// #MARK: That produced different first HTML on server vs client and triggered hydration mismatch.
const [state, setState] = useState<AnimationState>(INITIAL_STATE);

useEffect(() => {
if (didAnimationComplete()) return;
// #MARK: Read persisted completion only after mount so the first client render matches SSR output.
if (didAnimationComplete()) {
setState(COMPLETED_STATE);
return;
}

let cancelled = false;

Expand Down