Skip to content

Commit a02e649

Browse files
committed
ADD - localhost db connection working
1 parent 96f5e0e commit a02e649

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

client/src/App.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Hero } from "./components/Hero.jsx";
55
import { MainPage } from "./components/MainPage.jsx";
66
import { ProjectsPage } from "./components/ProjectsPage.jsx";
77
import { ShopPage } from "./components/ShopPage.jsx";
8+
import { TestPage } from "./components/TestPage.jsx";
89
import { AdminPage } from "./components/AdminPage.jsx";
910
import { UserAreaPage } from "./components/UserAreaPage.jsx";
1011

@@ -13,6 +14,7 @@ const ADMIN_ONLY = new Set(["/admin"]);
1314

1415
export default function App() {
1516
const [auth, setAuth] = useState({ status: "loading", user: null });
17+
const isLocalhost = ["localhost", "127.0.0.1"].includes(window.location.hostname);
1618

1719
const loadMe = useCallback(async () => {
1820
try {
@@ -66,8 +68,8 @@ export default function App() {
6668
page = <MainPage />;
6769
break;
6870
case "/test":
69-
window.location.replace("/admin#admin-airtable-sync");
70-
return null;
71+
page = isLocalhost ? <TestPage /> : <AdminPage />;
72+
break;
7173
case "/projects":
7274
page = <ProjectsPage />;
7375
break;

stack_prod.dump

4.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)