[bugfix] useStdoutToPython: fix the send data that can't send 0, int, data.
This commit is contained in:
@@ -2,9 +2,9 @@ import { store } from "@store";
|
||||
import { encode } from "js-base64";
|
||||
|
||||
export const useStdoutToPython = () => {
|
||||
const asyncStdoutToPython = async (path, value) => {
|
||||
const asyncStdoutToPython = async (path, value = undefined) => {
|
||||
let send_object = { endpoint: path };
|
||||
if (value) send_object.data = encode(JSON.stringify(value));
|
||||
if (value !== undefined) send_object.data = encode(JSON.stringify(value));
|
||||
|
||||
// send to python
|
||||
const backend_subprocess = store.backend_subprocess;
|
||||
|
||||
Reference in New Issue
Block a user