fix: pause playback during delete particle overlay
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { useCallback, useState } from "react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { ConfirmDestructiveOverlay } from "@/components/confirm-destructive-overlay";
|
||||
import { softDeleteParticle } from "@/lib/firestore-particles";
|
||||
import { particlePath, toFirestoreDocPath } from "@/lib/particle-path";
|
||||
import type { Particle } from "@/api/types";
|
||||
import { usePlaybackSuspenderStore } from "@/stores/playback-suspender-store";
|
||||
|
||||
interface DeleteParticleOverlayProps {
|
||||
networkId: string;
|
||||
@@ -20,6 +21,13 @@ export function DeleteParticleOverlay({
|
||||
userId,
|
||||
onClose,
|
||||
}: DeleteParticleOverlayProps) {
|
||||
// Suspend stream playback
|
||||
useEffect(() => {
|
||||
const { suspend, release } = usePlaybackSuspenderStore.getState();
|
||||
suspend();
|
||||
return release;
|
||||
}, []);
|
||||
|
||||
const [deleting, setDeleting] = useState(false);
|
||||
|
||||
const handleDelete = useCallback(async () => {
|
||||
|
||||
Reference in New Issue
Block a user