mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-01 21:24:13 +02:00
New sidebar and folder view (#263)
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import { useSearch } from '@tanstack/react-router';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { atom } from 'jotai';
|
||||
import { useEffect } from 'react';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
|
||||
export const activeRequestIdAtom = atom<string | null>(null);
|
||||
|
||||
export function useActiveRequestId(): string | null {
|
||||
return useAtomValue(activeRequestIdAtom);
|
||||
}
|
||||
|
||||
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