Skip to content

Commit

Permalink
Update assets
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE authored and github-actions[bot] committed Jan 26, 2025
1 parent 07e4340 commit a414c2c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 68 deletions.
31 changes: 11 additions & 20 deletions priv/static/phoenix_live_view.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.cjs.js.map

Large diffs are not rendered by default.

31 changes: 11 additions & 20 deletions priv/static/phoenix_live_view.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.esm.js.map

Large diffs are not rendered by default.

31 changes: 11 additions & 20 deletions priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3610,7 +3610,11 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
this.formsForRecovery = this.getFormsForRecovery();
}
if (this.isMain() && window.history.state === null) {
this.liveSocket.replaceRootHistory();
browser_default.pushState("replace", {
type: "patch",
id: this.id,
position: this.liveSocket.currentHistoryPosition
});
}
if (liveview_version !== this.liveSocket.version()) {
console.error(`LiveView asset version mismatch. JavaScript version ${this.liveSocket.version()} vs. server ${liveview_version}. To avoid issues, please ensure that your assets use the same version as the server.`);
Expand Down Expand Up @@ -5306,25 +5310,21 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
if (!this.registerNewLocation(window.location)) {
return;
}
let { type, backType, id, root, scroll, position } = event.state || {};
let { type, backType, id, scroll, position } = event.state || {};
let href = window.location.href;
let isForward = position > this.currentHistoryPosition;
type = isForward ? type : backType || type;
this.currentHistoryPosition = position || 0;
this.sessionStorage.setItem(PHX_LV_HISTORY_POSITION, this.currentHistoryPosition.toString());
dom_default.dispatchEvent(window, "phx:navigate", { detail: { href, patch: type === "patch", pop: true, direction: isForward ? "forward" : "backward" } });
this.requestDOMUpdate(() => {
const callback = () => {
this.maybeScroll(scroll);
};
if (this.main.isConnected() && (type === "patch" && id === this.main.id)) {
this.main.pushLinkPatch(event, href, null, () => {
this.maybeScroll(scroll);
});
this.main.pushLinkPatch(event, href, null, callback);
} else {
this.replaceMain(href, null, () => {
if (root) {
this.replaceRootHistory();
}
this.maybeScroll(scroll);
});
this.replaceMain(href, null, callback);
}
});
}, false);
Expand Down Expand Up @@ -5431,15 +5431,6 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
});
});
}
replaceRootHistory() {
browser_default.pushState("replace", {
root: true,
type: "patch",
id: this.main.id,
position: this.currentHistoryPosition
// Preserve current position
});
}
registerNewLocation(newLocation) {
let { pathname, search } = this.currentLocation;
if (pathname + search === newLocation.pathname + newLocation.search) {
Expand Down
8 changes: 4 additions & 4 deletions priv/static/phoenix_live_view.min.js

Large diffs are not rendered by default.

0 comments on commit a414c2c

Please sign in to comment.