mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Optimize sidebar collapsing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useParams } from '@tanstack/react-router';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { useEffect } from 'react';
|
||||
import {jotaiStore} from "../lib/jotai";
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
|
||||
export const activeRequestIdAtom = atom<string>();
|
||||
|
||||
@@ -11,7 +11,5 @@ export function useActiveRequestId(): string | null {
|
||||
|
||||
export function useSubscribeActiveRequestId() {
|
||||
const { requestId } = useParams({ strict: false });
|
||||
useEffect(() => {
|
||||
jotaiStore.set(activeRequestIdAtom, requestId);
|
||||
}, [requestId]);
|
||||
useEffect(() => jotaiStore.set(activeRequestIdAtom, requestId), [requestId]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user