Skip to content

Commit

Permalink
Instead of checking for parent before re-init the component, just cat…
Browse files Browse the repository at this point in the history
…ch any error that gets thrown.
  • Loading branch information
adamghill committed Oct 11, 2023
1 parent 4f3945e commit c22fcf0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django_unicorn/static/unicorn/js/messageSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ export function send(component, callback) {

component.triggerLifecycleEvent("updated");

if (!responseJson.parent) {
// Re-init to refresh the root and checksum based on the new data
try {
component.init();
} catch (err) {
// No id found error will be thrown here for child components.
return;
}

// Reset all event listeners
Expand Down

0 comments on commit c22fcf0

Please sign in to comment.