From e23ac7f4c1a30bfc9a0ab9cc38cb591a01621605 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Thu, 17 Oct 2024 01:37:26 +0530 Subject: [PATCH] chore: fix --- frontend/src/components/ExternalLink.tsx | 4 +++- frontend/src/components/layouts/AppLayout.tsx | 8 ++++++-- frontend/src/screens/BackupNode.tsx | 4 +++- frontend/src/screens/setup/RestoreNode.tsx | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/ExternalLink.tsx b/frontend/src/components/ExternalLink.tsx index c76d31a1..8541db14 100644 --- a/frontend/src/components/ExternalLink.tsx +++ b/frontend/src/components/ExternalLink.tsx @@ -8,7 +8,9 @@ type Props = { }; export default function ExternalLink({ to, className, children }: Props) { - const isHttpMode = window.location.protocol.startsWith("http"); + const isHttpMode = + window.location.hostname !== "wails.localhost" && + window.location.protocol.startsWith("http"); return isHttpMode ? ( { e.preventDefault(); - const isHttpMode = window.location.protocol.startsWith("http"); + const isHttpMode = + window.location.hostname !== "wails.localhost" && + window.location.protocol.startsWith("http"); try { setLoading(true); diff --git a/frontend/src/screens/setup/RestoreNode.tsx b/frontend/src/screens/setup/RestoreNode.tsx index 0cd5fd95..6ee10ee7 100644 --- a/frontend/src/screens/setup/RestoreNode.tsx +++ b/frontend/src/screens/setup/RestoreNode.tsx @@ -34,7 +34,9 @@ export function RestoreNode() { const [loading, setLoading] = useState(false); const [restored, setRestored] = useState(false); const { data: info } = useInfo(restored); - const isHttpMode = window.location.protocol.startsWith("http"); + const isHttpMode = + window.location.hostname !== "wails.localhost" && + window.location.protocol.startsWith("http"); React.useEffect(() => { if (restored && info?.setupCompleted) {