refactor: rename playback suspender

This commit is contained in:
talksik
2026-04-13 09:03:24 -07:00
parent 81a82eee38
commit bf6fdd15b5
3 changed files with 6 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
import { create } from "zustand";
/**
* Overlays that should pause stream playback (e.g. attachment lightbox) call
* `suspend()` on mount and `release()` on unmount. Stream playback is suspended
* whenever `suspendCount > 0`.
*/
interface PlaybackSuspenderState {
suspendCount: number;
suspend: () => void;
release: () => void;
}
export const usePlaybackSuspenderStore = create<PlaybackSuspenderState>((set) => ({
suspendCount: 0,
suspend: () => set((s) => ({ suspendCount: s.suspendCount + 1 })),
release: () => set((s) => ({ suspendCount: Math.max(0, s.suspendCount - 1) })),
}));