feat: customer's torrent streamer can be set
This commit is contained in:
1 parent
0f5c73c183
commit
cd3fabc0d8
5 files changed
+38
-11
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user