1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-12 01:40:53 +01:00

Fixed errors

This commit is contained in:
Feenix 2022-08-17 17:08:26 +05:30
commit 3ea6a45520
3 changed files with 11 additions and 0 deletions

View File

@ -7,4 +7,10 @@ contextBridge.exposeInMainWorld("electron", {
ipcRenderer.on(command, (event, args) => {
func(event, args);
}),
startListen: (func) => {
ipcRenderer.addListener("stdout",func)
},
stopListen: (func) => {
ipcRenderer.removeListener("stdout",func)
},
});

View File

@ -5,6 +5,8 @@ const Home = () => {
const [loaded, setLoaded] = useState(false);
useEffect(() => {
const handleMessage = (_event, args) => console.log(args)
window.electron.startListen(handleMessage)
// send(command, payload)
window.electron.send("sendMessage", { message: "Hello!" });
setLoaded(true);
@ -16,6 +18,9 @@ const Home = () => {
window.electron.on("done", (_, data) => {
console.log("DONE!");
});
return () => {
window.electron.stopListen(handleMessage)
}
}, []);
const imageHandler = async () => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB