Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

render correct host in the link

Oleg Isonen5bd1c5449a41
diff --git a/app/designer/features/topbar/publish.tsx b/app/designer/features/topbar/publish.tsx
index f1924b0ff4..a120bfa2b6 100644
--- a/app/designer/features/topbar/publish.tsx
+++ b/app/designer/features/topbar/publish.tsx
@@ -18,6 +18,13 @@ import { useIsPublishDialogOpen } from "../../shared/nano-values";
type PublishProps = { project: Project };
+const host =
+ typeof location === "object"
+ ? location.host.includes("webstudio.is")
+ ? "wstd.io"
+ : location.host
+ : "";
+
const Content = ({ project }: PublishProps) => {
const id = useId();
const fetcher = useFetcher();
@@ -28,9 +35,6 @@ const Content = ({ project }: PublishProps) => {
if (typeof location !== "object" || !domain) {
return;
}
- const host = location.host.includes("webstudio.is")
- ? "wstd.io"
- : location.host;
setUrl(`${location.protocol}//${domain}.${host}`);
}, [domain]);
@@ -60,7 +64,7 @@ const Content = ({ project }: PublishProps) => {
textOverflow: "ellipsis",
}}
>
- {`${domain}.${location.host}`}{" "}
+ {`${domain}.${host}`}{" "}
</Text>
<ExternalLinkIcon />
</Link>