Skip to content

Commit cc97bd3

Browse files
committed
back first pull
1 parent c3377fc commit cc97bd3

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,6 +2022,15 @@ var Component = class {
20222022
return response;
20232023
}
20242024
this.processRerender(html, backendResponse);
2025+
const liveUrl = backendResponse.getLiveUrl();
2026+
if (liveUrl) {
2027+
history.replaceState(
2028+
history.state,
2029+
"",
2030+
new URL(liveUrl + window.location.hash, window.location.origin)
2031+
);
2032+
}
2033+
this.hooks.triggerHook("render:finished", this);
20252034
this.backendRequest = null;
20262035
thisPromiseResolve(backendResponse);
20272036
if (this.isRequestPending) {
@@ -2098,11 +2107,6 @@ var Component = class {
20982107
})
20992108
);
21002109
});
2101-
const liveUrl = backendResponse.getLiveUrl();
2102-
if (liveUrl) {
2103-
history.replaceState(history.state, "", new URL(liveUrl + window.location.hash, window.location.origin));
2104-
}
2105-
this.hooks.triggerHook("render:finished", this);
21062110
}
21072111
calculateDebounce(debounce) {
21082112
if (debounce === true) {

src/LiveComponent/assets/src/Component/index.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ export default class Component {
329329

330330
this.processRerender(html, backendResponse);
331331

332+
const liveUrl = backendResponse.getLiveUrl();
333+
if (liveUrl) {
334+
history.replaceState(
335+
history.state,
336+
'',
337+
new URL(liveUrl + window.location.hash, window.location.origin)
338+
);
339+
}
340+
341+
this.hooks.triggerHook('render:finished', this);
342+
332343
// finally resolve this promise
333344
this.backendRequest = null;
334345
thisPromiseResolve(backendResponse);
@@ -438,13 +449,6 @@ export default class Component {
438449
})
439450
);
440451
});
441-
442-
const liveUrl = backendResponse.getLiveUrl();
443-
if (liveUrl) {
444-
history.replaceState(history.state, '', new URL(liveUrl + window.location.hash, window.location.origin));
445-
}
446-
447-
this.hooks.triggerHook('render:finished', this);
448452
}
449453

450454
private calculateDebounce(debounce: number | boolean): number {

0 commit comments

Comments
 (0)