Skip to content

Commit

Permalink
fix forcereload.
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestaSafe committed Sep 3, 2024
1 parent 5ceda35 commit 5736b77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions _dev/src/scripts/eventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ export const eventHandler = async (event) => {
current_url: custom_url
}
});
prettyBlocksContext.changeUrl(custom_url)
if(force_reload) {
window.location.reload()
}else{
prettyBlocksContext.changeUrl(custom_url)
}
}

Expand Down
10 changes: 7 additions & 3 deletions views/js/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9092,10 +9092,11 @@ This will fail in production.`);
current_url: custom_url
}
});
console.log("changeUrl", custom_url);
console.log("force_reload", force_reload);
prettyBlocksContext.changeUrl(custom_url);
if (force_reload) {
window.location.reload();
} else {
prettyBlocksContext.changeUrl(custom_url);
}
}
if (event.data.type == "updateTitleComponent") {
Expand Down Expand Up @@ -9630,6 +9631,7 @@ This will fail in production.`);
this.sendPrettyBlocksEvents("getContext");
this.sendPrettyBlocksEvents("getZones");
this.hideLoader();
this.emit("iframeLoaded");
}, 100);
});
},
Expand All @@ -9644,6 +9646,7 @@ This will fail in production.`);
this.pushUrl(url);
this.showLoader();
this.setIframe();
this.emit("urlChanged", url);
},
showLoader() {
this.$patch((state) => {
Expand All @@ -9657,6 +9660,8 @@ This will fail in production.`);
},
pushUrl(url) {
const currentUrl = new URL(window.location.href);
currentUrl.searchParams.delete("id");
currentUrl.searchParams.delete("endpoint");
currentUrl.searchParams.set("startup_url", this.updateFilteredURL(url));
window.history.replaceState({}, "", currentUrl.toString());
},
Expand All @@ -9677,7 +9682,6 @@ This will fail in production.`);
if (currentSrc === false) {
currentSrc = url;
}
console.log("currentSrc", currentSrc);
this.iframe.domElement.src = "";
setTimeout(() => {
this.iframe.domElement.src = currentSrc;
Expand Down

0 comments on commit 5736b77

Please sign in to comment.