Intento de meter las llamadas rest, creado el evento del IPC, no se
puede desde el renderer
This commit is contained in:
@@ -4,7 +4,6 @@ import { electronApp, optimizer, is } from "@electron-toolkit/utils";
|
||||
import icon from "../../resources/icon.png?asset";
|
||||
import { NfcService } from "../services/NfcService";
|
||||
|
||||
|
||||
function createWindow(): void {
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
@@ -60,6 +59,12 @@ app.whenReady().then(() => {
|
||||
// IPC test
|
||||
ipcMain.on("ping", () => console.log("pong"));
|
||||
|
||||
// HANDLE es bidireccionar ON es unidireccional
|
||||
ipcMain.handle("nfc:labelReq", async (_event, data: unknown) => {
|
||||
console.log("nfc:labelReq", data);
|
||||
return data;
|
||||
});
|
||||
|
||||
ipcMain.handle("ping:url", async (_event, url: string) => {
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user