Skip to content

Commit

Permalink
fix: Force reload only if same url is opened on same window
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Nov 13, 2024
1 parent e3fb4df commit 0560a14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ const useStore = defineStore("store", {
}
});
}
window.open(`/${route}`, "builder-preview");
const targetWindow = window.open(`/${route}`, "builder-preview");
if (targetWindow?.location.pathname === `/${route}`) {
targetWindow?.location.reload();
}
},
savePage() {
this.pageBlocks = this.getPageBlocks() as Block[];
Expand Down

0 comments on commit 0560a14

Please sign in to comment.