mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 00:58:32 +02:00
Switch to BiomeJS (#306)
This commit is contained in:
@@ -19,7 +19,7 @@ export function useSubscribeActiveCookieJarId() {
|
||||
|
||||
useEffect(() => {
|
||||
if (search == null) return; // Happens during Vite hot reload
|
||||
const activeCookieJar = cookieJars?.find((j) => j.id == cookieJarId) ?? null;
|
||||
const activeCookieJar = cookieJars?.find((j) => j.id === cookieJarId) ?? null;
|
||||
jotaiStore.set(activeCookieJarAtom, activeCookieJar);
|
||||
}, [cookieJarId, cookieJars, search]);
|
||||
}
|
||||
@@ -33,6 +33,11 @@ export function useEnsureActiveCookieJar() {
|
||||
const { cookie_jar_id: activeCookieJarId } = useSearch({ from: '/workspaces/$workspaceId/' });
|
||||
|
||||
// Set the active cookie jar to the first one, if none set
|
||||
// NOTE: We only run this on cookieJars to prevent data races when switching workspaces since a lot of
|
||||
// things change when switching workspaces, and we don't currently have a good way to ensure that all
|
||||
// stores have updated.
|
||||
// TODO: Create a global data store that can handle this case
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
||||
useEffect(() => {
|
||||
if (cookieJars == null) return; // Hasn't loaded yet
|
||||
|
||||
@@ -49,11 +54,5 @@ export function useEnsureActiveCookieJar() {
|
||||
// There's no active jar, so set it to the first one
|
||||
console.log('Defaulting active cookie jar to first jar', firstJar);
|
||||
setWorkspaceSearchParams({ cookie_jar_id: firstJar.id });
|
||||
|
||||
// NOTE: We only run this on cookieJars to prevent data races when switching workspaces since a lot of
|
||||
// things change when switching workspaces, and we don't currently have a good way to ensure that all
|
||||
// stores have updated.
|
||||
// TODO: Create a global data store that can handle this case
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [cookieJars]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user