mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 08:21:19 +02:00
Refactor desktop app into separate client and proxy apps
This commit is contained in:
11
apps/yaak-client/hooks/useActiveRequestId.ts
Normal file
11
apps/yaak-client/hooks/useActiveRequestId.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useSearch } from '@tanstack/react-router';
|
||||
import { atom } from 'jotai';
|
||||
import { useEffect } from 'react';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
|
||||
export const activeRequestIdAtom = atom<string | null>(null);
|
||||
|
||||
export function useSubscribeActiveRequestId() {
|
||||
const { request_id } = useSearch({ strict: false });
|
||||
useEffect(() => jotaiStore.set(activeRequestIdAtom, request_id ?? null), [request_id]);
|
||||
}
|
||||
Reference in New Issue
Block a user