Skip to content

Commit c3e2bff

Browse files
committed
Remove code to handle reload event
1 parent 0792f2f commit c3e2bff

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

backend/ipc.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ module.exports = function registerIPCHandlers(win, ipcMain, app, dialog) {
144144
win.webContents.send('check-before-close')
145145
})
146146

147-
// handle disconnection before reload
148-
ipcMain.handle('prepare-reload', async (event) => {
149-
return win.webContents.send('before-reload')
150-
})
151-
152147
ipcMain.handle('serial', (event, command, ...args) => {
153148
console.debug('Handling IPC serial command:', command, ...args)
154149
return serial[command](...args)

index.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,6 @@ function createWindow () {
5050
win.show()
5151
})
5252

53-
win.webContents.on('before-reload', async (event) => {
54-
// Prevent the default reload behavior
55-
event.preventDefault()
56-
57-
try {
58-
// Tell renderer to do cleanup
59-
win.webContents.send('cleanup-before-reload')
60-
61-
// Wait for cleanup then reload
62-
setTimeout(() => {
63-
// This will trigger a page reload, but won't trigger 'before-reload' again
64-
win.reload()
65-
}, 500)
66-
} catch(e) {
67-
console.error('Reload preparation failed:', e)
68-
}
69-
})
70-
7153
const initialMenuState = {
7254
isConnected: false,
7355
view: 'editor'

preload.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ const Window = {
6464
})
6565
},
6666

67-
onBeforeReload: (callback) => {
68-
ipcRenderer.on('cleanup-before-reload', async () => {
69-
try {
70-
await callback()
71-
} catch(e) {
72-
console.error('Cleanup before reload failed:', e)
73-
}
74-
})
75-
},
76-
7767
beforeClose: (callback) => ipcRenderer.on('check-before-close', callback),
7868
confirmClose: () => ipcRenderer.invoke('confirm-close'),
7969
isPackaged: () => ipcRenderer.invoke('is-packaged'),

ui/arduino/store.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,18 +1391,6 @@ async function store(state, emitter) {
13911391
emitter.emit('render')
13921392
})
13931393

1394-
win.onBeforeReload(async () => {
1395-
// Perform any cleanup needed
1396-
if (state.isConnected) {
1397-
await serialBridge.disconnect()
1398-
state.isConnected = false
1399-
state.panelHeight = PANEL_CLOSED
1400-
state.boardFiles = []
1401-
state.boardNavigationPath = '/'
1402-
}
1403-
// Any other cleanup needed
1404-
})
1405-
14061394
win.beforeClose(async () => {
14071395
const hasChanges = !!state.openFiles.find(f => f.hasChanges)
14081396
if (hasChanges) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy