fix(js): reload stale popstate partials
When back/forward navigation receives an incompatible or unusable partial response, reload the current URL instead of leaving the previous UI stale. req: page_swap/005 req: page_swap/006 req: runtime/004
This commit is contained in:
@@ -180,8 +180,9 @@
|
||||
headers: { "X-SLHX-Partial": "1", "Accept": "text/html" },
|
||||
credentials: "same-origin",
|
||||
});
|
||||
if (!await applyResponse(response, root) && mode !== "none") {
|
||||
location.href = href;
|
||||
if (!await applyResponse(response, root)) {
|
||||
if (mode === "none") location.reload();
|
||||
else location.href = href;
|
||||
return;
|
||||
}
|
||||
if (mode === "push") history.pushState({ slhx: true }, "", href);
|
||||
|
||||
Reference in New Issue
Block a user