mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
Fixed errors
This commit is contained in:
commit
3ea6a45520
@ -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)
|
||||
},
|
||||
});
|
||||
|
@ -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 |
Loading…
Reference in New Issue
Block a user