[bugfix] useStdoutToPython: fix the send data that can't send 0, int, data.

This commit is contained in:
Sakamoto Shiina
2024-09-25 23:42:18 +09:00
parent 69d835855c
commit a43b4df8ef

View File

@@ -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;