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.

fix: Project outdated when switching on preview and link hashes (#2564)

Ivan Starkovcd049ff912d1
diff --git a/apps/builder/app/builder/shared/sync/command-queue.ts b/apps/builder/app/builder/shared/sync/command-queue.ts
index ed9825584b..77ca711b43 100644
--- a/apps/builder/app/builder/shared/sync/command-queue.ts
+++ b/apps/builder/app/builder/shared/sync/command-queue.ts
@@ -39,11 +39,6 @@ export const enqueue = (command: Command) => {
projectCommandsQueue.push(command);
};
-export const dequeue = () => {
- const command = projectCommandsQueue.pop();
- return command;
-};
-
export const dequeueAll = () => {
const commands = [...projectCommandsQueue];
projectCommandsQueue.length = 0;
diff --git a/apps/builder/app/routes/builder.$projectId.tsx b/apps/builder/app/routes/builder.$projectId.tsx
index d0174fb3e2..8963246050 100644
--- a/apps/builder/app/routes/builder.$projectId.tsx
+++ b/apps/builder/app/routes/builder.$projectId.tsx
@@ -127,6 +127,13 @@ export const shouldRevalidate: ShouldRevalidateFunction = ({
// to not regenerate auth token and preserve canvas url
currentUrlCopy.searchParams.delete("pageId");
nextUrlCopy.searchParams.delete("pageId");
+
+ currentUrlCopy.searchParams.delete("mode");
+ nextUrlCopy.searchParams.delete("mode");
+
+ currentUrlCopy.searchParams.delete("pageHash");
+ nextUrlCopy.searchParams.delete("pageHash");
+
return currentUrlCopy.href === nextUrlCopy.href
? false
: defaultShouldRevalidate;