feat: customer's torrent streamer can be set

This commit is contained in:
ner committed 2025-08-14 14:29:30 +03:00
1 parent 0f5c73c183
commit cd3fabc0d8
5 files changed
+38 -11

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { useAtomValue, useSetAtom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
import { STREAM_URL } from '@/env';
const streamUrlAtom = atomWithStorage<string>('stream url', STREAM_URL, undefined, {
unstable_getOnInit: true
});
export const useSetStreamUrl = () => useSetAtom(streamUrlAtom);
export const useStreamUrl = () => useAtomValue(streamUrlAtom) || STREAM_URL;