Merge branch 'ui' into develop
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
import { Command } from "@tauri-apps/api/shell";
|
import { Command } from "@tauri-apps/api/shell";
|
||||||
import { store } from "@store";
|
import { store } from "@store";
|
||||||
import { useReceiveRoutes } from "./useReceiveRoutes";
|
import { useReceiveRoutes } from "./useReceiveRoutes";
|
||||||
|
import {
|
||||||
|
useNotificationStatus,
|
||||||
|
} from "@logics_common";
|
||||||
|
|
||||||
export const useStartPython = () => {
|
export const useStartPython = () => {
|
||||||
const { receiveRoutes } = useReceiveRoutes();
|
const { receiveRoutes } = useReceiveRoutes();
|
||||||
|
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
|
||||||
|
|
||||||
const asyncStartPython = async () => {
|
const asyncStartPython = async () => {
|
||||||
const command = Command.sidecar("bin/VRCT-sidecar");
|
const command = Command.sidecar("bin/VRCT-sidecar");
|
||||||
@@ -16,7 +21,11 @@ export const useStartPython = () => {
|
|||||||
console.log(error, line);
|
console.log(error, line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
command.stderr.on("data", line => console.error("stderr:", line));
|
command.stderr.on("data", line => {
|
||||||
|
showNotification_Error(
|
||||||
|
`An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null });
|
||||||
|
console.error("stderr", line)
|
||||||
|
});
|
||||||
const backend_subprocess = await command.spawn();
|
const backend_subprocess = await command.spawn();
|
||||||
store.backend_subprocess = backend_subprocess;
|
store.backend_subprocess = backend_subprocess;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user