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.

don't use `config` in getCanvasRequestParams

Roman Pominovf8904603a076
diff --git a/apps/designer/app/entry.server.tsx b/apps/designer/app/entry.server.tsx
index 207355a6c3..286acca6ae 100644
--- a/apps/designer/app/entry.server.tsx
+++ b/apps/designer/app/entry.server.tsx
@@ -18,7 +18,13 @@ export default function handleRequest(
) {
let handle = handleRequestDesigner;
- if (getCanvasRequestParams(request) !== undefined) {
+ if (
+ remixContext.matches.some(
+ (match) =>
+ match.route.id === "routes/$" || match.route.id === "routes/index"
+ ) &&
+ getCanvasRequestParams(request) !== undefined
+ ) {
handle = handleRequestCanvas;
}
diff --git a/apps/designer/app/shared/router-utils/canvas-request-params.ts b/apps/designer/app/shared/router-utils/canvas-request-params.ts
index 5b6f0e7ecc..bc10e28443 100644
--- a/apps/designer/app/shared/router-utils/canvas-request-params.ts
+++ b/apps/designer/app/shared/router-utils/canvas-request-params.ts
@@ -1,5 +1,3 @@
-import config from "~/config";
-
export type CanvasRouteMode = "edit" | "preview" | "published";
const modes = ["edit", "preview", "published"] as CanvasRouteMode[];
@@ -23,10 +21,6 @@ export const getCanvasRequestParams = (request: {
const pathname = url.pathname;
- if (Object.values(config).some((path) => pathname.startsWith(path))) {
- return undefined;
- }
-
const projectId = url.searchParams.get("projectId");
let projectDomain = undefined;