Fix active cookie jar and improve routing

This commit is contained in:
Gregory Schier
2024-10-28 10:06:43 -07:00
parent 4a52095033
commit 6d2c3712c0
19 changed files with 95 additions and 71 deletions

View File

@@ -18,6 +18,8 @@ export function useActiveCookieJar() {
export function useEnsureActiveCookieJar() {
const cookieJars = useCookieJars();
const [activeCookieJarId, setActiveCookieJarId] = useActiveCookieJarId();
// Set the active cookie jar to the first one, if none set
useEffect(() => {
if (cookieJars == null) return; // Hasn't loaded yet
if (cookieJars.find((j) => j.id === activeCookieJarId)) {