mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:18:30 +02:00
Some fixes around environments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getRouteApi, useSearch } from '@tanstack/react-router';
|
||||
import { useNavigate, useSearch } from '@tanstack/react-router';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { useCookieJars } from './useCookieJars';
|
||||
|
||||
@@ -38,17 +38,15 @@ export function useEnsureActiveCookieJar() {
|
||||
}, [activeCookieJarId, cookieJars, setActiveCookieJarId]);
|
||||
}
|
||||
|
||||
const routeApi = getRouteApi('/workspaces/$workspaceId/');
|
||||
|
||||
function useActiveCookieJarId() {
|
||||
// NOTE: This query param is accessed from Rust side, so do not change
|
||||
const { cookieJarId: id } = useSearch({ strict: false });
|
||||
const navigate = routeApi.useNavigate();
|
||||
const { cookie_jar_id: id } = useSearch({ strict: false });
|
||||
const navigate = useNavigate({ from: '/workspaces/$workspaceId' });
|
||||
|
||||
const setId = useCallback(
|
||||
(id: string) =>
|
||||
navigate({
|
||||
search: (prev) => ({ ...prev, cookieJarId: id }),
|
||||
search: (prev) => ({ ...prev, cookie_jar_id: id }),
|
||||
}),
|
||||
[navigate],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user