Skip to content

Commit

Permalink
navigate to login from status if user is not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
gatzjames committed Oct 2, 2023
1 parent 3ace14e commit fb9c0a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/insomnia/src/ui/routes/organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
ShouldRevalidateFunction,
useFetcher,
useLoaderData,
useNavigate,
useParams,
useRouteLoaderData,
} from 'react-router-dom';
Expand Down Expand Up @@ -350,6 +351,7 @@ const OrganizationRoute = () => {
':workspaceId',
) as WorkspaceLoaderData | null;
const logoutFetcher = useFetcher();
const navigate = useNavigate();
const [isScratchPadBannerDismissed, setIsScratchPadBannerDismissed] = useLocalStorage('scratchpad-banner-dismissed', '');
const isScratchpadWorkspace =
workspaceData?.activeWorkspace &&
Expand Down Expand Up @@ -618,7 +620,12 @@ const OrganizationRoute = () => {
</Tooltip>
</TooltipTrigger>
<TooltipTrigger>
<Button className="px-4 py-1 h-full flex items-center justify-center gap-2 aria-pressed:bg-[--hl-sm] text-[--color-font] text-xs hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all">
<Button
className="px-4 py-1 h-full flex items-center justify-center gap-2 aria-pressed:bg-[--hl-sm] text-[--color-font] text-xs hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all"
onPress={() => {
!user && navigate('/auth/login');
}}
>
<Icon
icon="circle"
className={
Expand Down

0 comments on commit fb9c0a1

Please sign in to comment.