Skip to content

Commit

Permalink
Execute JS in the very end of the message processing event loop
Browse files Browse the repository at this point in the history
Fixes #4444
  • Loading branch information
Denis Anisimov committed Jul 31, 2018
1 parent afe3149 commit 253c118
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@ assert getServerId(valueMap) == -1

if (json.hasKey(JsonConstants.UIDL_KEY_EXECUTE)) {
// Invoke JS only after all tree changes have been
// propagated
Reactive.addPostFlushListener(
() -> registry.getExecuteJavaScriptProcessor().execute(
json.getArray(JsonConstants.UIDL_KEY_EXECUTE)));
// propagated and in the very end of the browser event loop
Reactive.addPostFlushListener(() -> Scheduler.get()
.scheduleFinally(() -> registry
.getExecuteJavaScriptProcessor()
.execute(json.getArray(
JsonConstants.UIDL_KEY_EXECUTE))));
}

Console.log("handleUIDLMessage: "
Expand Down

0 comments on commit 253c118

Please sign in to comment.