atproto explorer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

move repo navigation logic

Juliet 654f4f12 39de0e20

+9 -14
+1 -4
src/components/search.tsx
··· 1 1 import { resolveHandle } from "../utils/api.js"; 2 - import { action, Navigate, redirect, useSubmission } from "@solidjs/router"; 2 + import { action, redirect, useSubmission } from "@solidjs/router"; 3 3 import Tooltip from "./tooltip.jsx"; 4 4 import { Show } from "solid-js"; 5 5 import { agent, loginState } from "../components/login.jsx"; ··· 71 71 children={ 72 72 <a href={`/at/${agent.sub}`} class="flex items-center"> 73 73 <button class="i-tabler-binary-tree text-xl" /> 74 - <Show when={location.pathname === "/"}> 75 - <Navigate href={`/at/${agent.sub}`} /> 76 - </Show> 77 74 </a> 78 75 } 79 76 />
+8 -10
src/layout.tsx
··· 1 1 import { createSignal, ErrorBoundary, onMount, Show, Suspense } from "solid-js"; 2 - import { 3 - RouteSectionProps, 4 - useLocation, 5 - useNavigate, 6 - useParams, 7 - } from "@solidjs/router"; 8 - import { loginState, retrieveSession } from "./components/login.jsx"; 2 + import { RouteSectionProps, useLocation, useParams } from "@solidjs/router"; 3 + import { agent, loginState, retrieveSession } from "./components/login.jsx"; 9 4 import { CreateRecord } from "./components/create.jsx"; 10 5 import Tooltip from "./components/tooltip.jsx"; 11 6 import { NavBar } from "./components/navbar.jsx"; ··· 27 22 navigator.registerProtocolHandler("web+at", "/%s"); 28 23 const pathname = decodeURIComponent(useLocation().pathname); 29 24 if (pathname.startsWith("/web+at://")) { 30 - const navigate = useNavigate(); 31 - navigate(pathname.replace("web+at://", "at/")); 25 + window.location.href = pathname.replace("web+at://", "at/"); 32 26 } 33 27 } catch (err) { 34 28 console.error(err); 35 29 } 36 30 const params = useParams(); 37 - onMount(async () => await retrieveSession()); 31 + onMount(async () => { 32 + await retrieveSession(); 33 + if (loginState() && location.pathname === "/") 34 + window.location.href = `/at/${agent.sub}`; 35 + }); 38 36 39 37 return ( 40 38 <div