Skip to content

Commit 3c3ddc2

Browse files
authored
ENG-8049: pass correct parameters to queueEvents (#5962)
There was also another place in the call_script callback path where the incorrect parameters have been passed since at least 0.8 πŸ™€
1 parent fd6e111 commit 3c3ddc2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

β€Žreflex/.templates/web/utils/state.jsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const queueEventIfSocketExists = async (
176176
if (!socket) {
177177
return;
178178
}
179-
await queueEvents(events, socket, navigate, params);
179+
await queueEvents(events, socket, false, navigate, params);
180180
};
181181

182182
/**
@@ -256,13 +256,13 @@ export const applyEvent = async (event, socket, navigate, params) => {
256256

257257
if (event.name == "_clear_session_storage") {
258258
sessionStorage.clear();
259-
queueEvents(initialEvents(), socket, navigate, params);
259+
queueEventIfSocketExists(initialEvents(), socket, navigate, params);
260260
return false;
261261
}
262262

263263
if (event.name == "_remove_session_storage") {
264264
sessionStorage.removeItem(event.payload.key);
265-
queueEvents(initialEvents(), socket, navigate, params);
265+
queueEventIfSocketExists(initialEvents(), socket, navigate, params);
266266
return false;
267267
}
268268

β€Žreflex/utils/format.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ def _default_args_spec():
586586
# Return the final code snippet, expecting queueEvents, processEvent, and socket to be in scope.
587587
# Typically this snippet will _only_ run from within an rx.call_script eval context.
588588
return Var(
589-
f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}); "
590-
f"processEvent({constants.CompileVars.SOCKET})}}",
589+
f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}, false, navigate, params);"
590+
f"processEvent({constants.CompileVars.SOCKET}, navigate, params);}}",
591591
).to(FunctionVar, EventChain)
592592

593593

0 commit comments

Comments
Β (0)