Skip to content

Commit

Permalink
Merge pull request #13 from gristlabs/alex/fix-code-view
Browse files Browse the repository at this point in the history
Only call toJs on python call result when it's defined, fixing code view
  • Loading branch information
alexmojaki authored Jun 28, 2023
2 parents 24c1be7 + 563e34d commit 6fae082
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 6fae082

Please sign in to comment.