Skip to content

Commit b511bff

Browse files
committed
refactor: use explicit 'on' helper for SPA routing effect
1 parent 04ff415 commit b511bff

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

dist/components/Bot.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Bot.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,10 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
556556
let ttsTimeoutRef: ReturnType<typeof setTimeout> | null = null;
557557
let hasAutoSentInitialMessage = false;
558558

559-
createEffect(() => {
559+
createEffect(on(() => props.chatflowid, () => {
560560
// Reset the auto-send flag when the chatflow ID changes (for SPA routing)
561-
props.chatflowid;
562561
hasAutoSentInitialMessage = false;
563-
});
564-
562+
}, { defer: true }));
565563

566564
createMemo(() => {
567565
const customerId = (props.chatflowConfig?.vars as any)?.customerId;

0 commit comments

Comments
 (0)