IPCRenderer Include Edemiyorum

IpcRenderer iste─čini bir turlu ├žal─▒┼čt─▒ramad─▒m. Sizce sorun nereden kaynaklan─▒yor ?

son durum. ipcRenderer include etmiyor. neden acaba.

import { ipcRenderer } from 'electron'

import { todo } from "./todo"

console.log(ipcRenderer);

let inputText = (<HTMLInputElement>document.getElementById("todoInputText"));
let addButton = (<HTMLButtonElement>document.getElementById("todoAddButton"));
let ToDoDataDiv = (<HTMLDivElement>document.getElementById('todoDataDiv'));

window.onload = function() {
    refreshList();
}

function refreshList() {

    ipcRenderer.send("get-todo");

    ipcRenderer.on('get-todo-reply', (event, response : Array<todo>) => {

        console.log(response[0].text);
        let t : Array<todo> = response;

        if (t.length > 0) {
    
            if (ToDoDataDiv.hasChildNodes()) {
                let i = 0;
                while (ToDoDataDiv.children.length < i) {
                    ToDoDataDiv.removeChild(ToDoDataDiv.children[i]);
                    i++;
                }
            }
        
            let tableElement = (<HTMLTableElement>document.createElement('table'));
        
            let tableRow = (<HTMLTableRowElement>document.createElement('tr'));
        
            let idText = (document.createElement('th'));
            idText.innerText = "ID";
            tableRow.appendChild(idText);
        
            tableElement.appendChild(tableRow);
        
            let i : number = 0;
            while (t.length > i) {
                let tableRow1 = (<HTMLTableRowElement>document.createElement('tr'));
                
                let td1 = (document.createElement('td'));
                td1.innerText = t[i].id.toString();
        
                let td2 = (document.createElement('td'));
                td2.innerText = t[i].text.toString();
        
                tableRow1.appendChild(td1);
                tableRow1.appendChild(td2);
        
                tableElement.appendChild(tableRow1);
            }
        
            ToDoDataDiv.appendChild(tableElement);
    
        }
    
    });

}

addButton.addEventListener('click', () => {
    console.log(inputText.value);
    if (inputText.value != "") {
        ipcRenderer.send('insert-todo', inputText.value);
        refreshList();
    }
});

----------- 

import { app, BrowserWindow, ipcMain } from "electron";
import * as path from "path";

import { sqliteconnect } from './sqliteconnect'
import { todo } from "./todo";

function createWindow() {
  const mainWindow = new BrowserWindow({
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, "preload.js"),
      nodeIntegration: true,
      contextIsolation: false,
    },
    width: 800,
  });

  ipcMain.on('get-todo', async (event) => {
    let t : Array<todo> = await sqliteconnect.getTodos();
    return t;
  });

  mainWindow.loadFile(path.join(__dirname, "../index.html"));

}

app.whenReady().then(() => {
  createWindow();

  app.on("activate", function () {
    if (BrowserWindow.getAllWindows().length === 0) createWindow();
  });
});

app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    app.quit();
  }
});

Merhaba, foruma ho┼č geldiniz! Kodlar─▒n─▒z─▒ yazarken CTRL+e ile ├Ânceden bi├žimlendirilmi┼č metni se├žerseniz g├╝zel olur. Kod daha okunakl─▒ oluyor. Onun d─▒┼č─▒nda ald─▒─č─▒n─▒z hata kayd─▒n─▒ da bizimle payla┼č─▒rsan─▒z belki daha fazla yard─▒mc─▒ olabiliriz.