Skip to content

Commit

Permalink
Added better pathing for routes
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoAbove committed Oct 15, 2024
1 parent 8d7794f commit d06422b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TestBench from "./TestBench";
import { Compute, ComputeConsole } from "./Compute";
import { ProfileContext } from "./Profile/ProfileContext";

import { isDev, isLocal } from "./utils";
import { isDev, isFullPath, isLocal } from "./utils";

const Body = () => {
const [searchParams, setSearchParams] = useSearchParams();
Expand Down Expand Up @@ -46,7 +46,7 @@ const Body = () => {

const isLoggedIn = !!patreonData;

const showTestBench = isDev() && isLocal();
const showTestBench = (isDev() && isLocal()) || isFullPath("/test");
const showClusterCompute = isLoggedIn; // || isDev();
const showClusterComputeConsole = false; // isLocal();

Expand Down
5 changes: 5 additions & 0 deletions src/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ export const isLocal = () => {
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/),
);
};

// Used for matching urls like /test
export const isFullPath = (target: string) => {
return window.location.pathname === target;
};

0 comments on commit d06422b

Please sign in to comment.