From 20fb9a4c6e086f329e7a19913cf83f5e14a05e4a Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 19 Mar 2026 16:05:02 -0700 Subject: [PATCH] fix: play new particle after playback is ended --- js/src/features/particles/stream-view.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/features/particles/stream-view.tsx b/js/src/features/particles/stream-view.tsx index e1e3760..1ac920d 100644 --- a/js/src/features/particles/stream-view.tsx +++ b/js/src/features/particles/stream-view.tsx @@ -79,6 +79,10 @@ function playbackReducer( if (action.particleCount === 0) { return { currentIndex: 0, status: "idle", paused: state.paused }; } + if (state.status === "ended" && state.currentIndex < action.particleCount - 1) { + // New particle appended — resume and advance to it + return { ...state, currentIndex: state.currentIndex + 1, status: "playing", paused: false }; + } if (state.currentIndex >= action.particleCount) { return { ...state, currentIndex: action.particleCount - 1 }; }