@@ -4,7 +4,7 @@ const fs = require('fs');
44
55const { registerAppIpcHandlers, terminateAllProcesses } = require ( './main-app-ipc' ) ;
66const { registerFsIpcHandlers, getAppDataDir } = require ( './main-fs-ipc' ) ;
7- const { registerCredIpcHandlers, cleanupWindowTrust } = require ( './main-cred-ipc' ) ;
7+ const { registerCredIpcHandlers } = require ( './main-cred-ipc' ) ;
88const { registerWindowIpcHandlers, registerWindow } = require ( './main-window-ipc' ) ;
99
1010// Request single instance lock - only one instance of the app should run at a time
@@ -19,10 +19,8 @@ if (!gotTheLock) {
1919// Used for multi-window storage synchronization
2020const sharedStorageMap = new Map ( ) ;
2121
22- let mainWindow ;
23-
2422async function createWindow ( ) {
25- mainWindow = new BrowserWindow ( {
23+ const win = new BrowserWindow ( {
2624 width : 1200 ,
2725 height : 800 ,
2826 webPreferences : {
@@ -34,18 +32,11 @@ async function createWindow() {
3432 } ) ;
3533
3634 // Register main window with label 'main' (mirrors Tauri's window labeling)
37- registerWindow ( mainWindow , 'main' ) ;
35+ // Trust cleanup is handled by registerWindow's closed handler
36+ registerWindow ( win , 'main' ) ;
3837
3938 // Load the test page from the http-server
40- mainWindow . loadURL ( 'http://localhost:8000/src/' ) ;
41-
42- mainWindow . webContents . on ( 'destroyed' , ( ) => {
43- cleanupWindowTrust ( mainWindow . webContents . id ) ;
44- } ) ;
45-
46- mainWindow . on ( 'closed' , ( ) => {
47- mainWindow = null ;
48- } ) ;
39+ win . loadURL ( 'http://localhost:8000/src/' ) ;
4940}
5041
5142async function gracefulShutdown ( exitCode = 0 ) {
0 commit comments