Skip to content

Commit

Permalink
Only call toJs on python call result when it's defined, fixing code view
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki committed Jun 28, 2023
1 parent f3f77f1 commit 563e34d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core
Submodule core updated 188 files
6 changes: 4 additions & 2 deletions ext/app/pipe/webworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ function start(pyodidePromise) {
addEventListener('message', async (e) => {
if (e.data.type === 'call') {
const { name, args } = e.data;
const result = (await pyodidePromise).globals.get("call")(name, args);
const data = result?.toJs({ dict_converter: Object.fromEntries });
let data = (await pyodidePromise).globals.get("call")(name, args);
if (data?.toJs) {
data = data.toJs({ dict_converter: Object.fromEntries });
}
postMessage({ type: 'data', data });
}
});
Expand Down

0 comments on commit 563e34d

Please sign in to comment.