Skip to content

Commit

Permalink
Ensure url is expanded on connect params
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Oct 4, 2023
1 parent 0943c3a commit 99462ea
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
5 changes: 3 additions & 2 deletions assets/js/phoenix_live_view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ export default class View {
this.children = this.parent ? null : {}
this.root.children[this.id] = {}
this.channel = this.liveSocket.channel(`lv:${this.id}`, () => {
let url = this.href && this.expandURL(this.href)
return {
redirect: this.redirect ? this.href : undefined,
url: this.redirect ? undefined : this.href || undefined,
redirect: this.redirect ? url : undefined,
url: this.redirect ? undefined : url || undefined,
params: this.connectParams(liveReferer),
session: this.getSession(),
static: this.getStatic(),
Expand Down
7 changes: 4 additions & 3 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.

7 changes: 4 additions & 3 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.

7 changes: 4 additions & 3 deletions priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
}
}
function morphChildren(fromEl, toEl) {
var skipFrom = skipFromChildren(fromEl);
var skipFrom = skipFromChildren(fromEl, toEl);
var curToNodeChild = toEl.firstChild;
var curFromNodeChild = fromEl.firstChild;
var curToNodeKey;
Expand Down Expand Up @@ -2703,9 +2703,10 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
this.children = this.parent ? null : {};
this.root.children[this.id] = {};
this.channel = this.liveSocket.channel(`lv:${this.id}`, () => {
let url = this.href && this.expandURL(this.href);
return {
redirect: this.redirect ? this.href : void 0,
url: this.redirect ? void 0 : this.href || void 0,
redirect: this.redirect ? url : void 0,
url: this.redirect ? void 0 : url || void 0,
params: this.connectParams(liveReferer),
session: this.getSession(),
static: this.getStatic(),
Expand Down
4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.min.js

Large diffs are not rendered by default.

0 comments on commit 99462ea

Please sign in to comment.