fix: prevent exit countdown during editing text

This commit is contained in:
talksik
2026-04-25 13:10:32 -07:00
parent a686d85e96
commit cf143f232d
@@ -1,4 +1,4 @@
import { useCallback, useState } from "react";
import { useCallback, useEffect, useState } from "react";
import { createPortal } from "react-dom";
import { toast } from "sonner";
import type { Particle } from "@/api/types";
@@ -10,6 +10,7 @@ import {
} from "@/lib/particle-path";
import { editTextParticleContent } from "@/lib/firestore-particles";
import { TextEditor } from "@/features/compose/text-editor";
import { usePlaybackSuspenderStore } from "@/stores/playback-suspender-store";
type TextParticle = Extract<Particle, { type: "text" }>;
@@ -24,6 +25,12 @@ export function TextEditOverlay({
streamPath,
onClose,
}: TextEditOverlayProps) {
useEffect(() => {
const { suspend, release } = usePlaybackSuspenderStore.getState();
suspend();
return release;
}, []);
const [textContent, setTextContent] = useState(particle.properties.content);
const [saving, setSaving] = useState(false);