I am using the electron-todo template and trying to create a log file that recovers the data in the event of a crash. The app reloads every time the log file is updated. How would I prevent the app from reloading every time? I intended the logging to occur in the background while the app keeps running. In the renderer I have the following:
const path = require("path");
const log = require("electron-log");
log.transports.file.resolvePath = () => path.join("renderer", 'main.log');
document.getElementById('todoForm').addEventListener('submit', (evt) => {
evt.preventDefault()
const input = evt.target[0]
ipcRenderer.send('add-todo', input.value)
.then(()=>{
log.info('Log todo:', input.value) //this is causing app to reload
})
.catch((err)=>{
alert('Cannot log todo')
})
})
I cannot see any console error output upon app reload, but the log file does record as it should.