File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -516,6 +516,20 @@ export const setupRootWindow = (): void => {
516516export const showRootWindow = async ( ) : Promise < void > => {
517517 const browserWindow = await getRootWindow ( ) ;
518518
519+ // Handle renderer process crashes
520+ browserWindow . webContents . on ( 'render-process-gone' , async ( event , details ) => {
521+ console . error ( 'Renderer process crashed:' , details . reason ) ;
522+ try {
523+ const session = browserWindow . webContents . session ;
524+ await session . clearCache ( ) ;
525+ await session . clearStorageData ( ) ;
526+ console . log ( 'Cache cleared. Reloading window...' ) ;
527+ browserWindow . reload ( ) ;
528+ } catch ( error ) {
529+ console . error ( 'Failed to recover from crash:' , error ) ;
530+ }
531+ } ) ;
532+
519533 browserWindow . loadFile ( path . join ( app . getAppPath ( ) , 'app/index.html' ) ) ;
520534
521535 if ( process . env . NODE_ENV === 'development' ) {
You can’t perform that action at this time.
0 commit comments