@@ -225,7 +225,8 @@ function confirmReload(title, message) {
225225 } ) ;
226226 copyButton . textContent = 'Copy Error' ;
227227 getHelpButton . textContent = 'Get Help' ;
228- reloadButton . textContent = 'Restart App' ;
228+ // In native apps, we can't reload because AES trust ring won't survive - must quit and restart manually
229+ reloadButton . textContent = Phoenix . isNativeApp ? 'Quit App' : 'Restart App' ;
229230 // Styling for visibility
230231 // Define common styles for buttons
231232 const buttonStyles = {
@@ -303,14 +304,22 @@ function confirmReload(title, message) {
303304 return new Promise ( resolve => {
304305 reloadButton . onclick = function ( ) {
305306 resolve ( true ) ;
306- reloadButton . textContent = 'Reloading...' ;
307+ reloadButton . textContent = Phoenix . isNativeApp ? 'Quitting...' : 'Reloading...' ;
307308 reloadButton . style . color = 'darkgray' ;
308309 reloadButton . style . backgroundColor = 'grey' ;
309310 } ;
310311 } ) ;
311312}
312313
313314function resetCacheAndRestart ( ) {
315+ // In native apps, we can't reload because AES trust ring won't survive - must quit
316+ if ( Phoenix . isNativeApp ) {
317+ // wait for 3 seconds for bugsnag to send report, then quit
318+ setTimeout ( ( ) => {
319+ Phoenix . app . closeWindow ( true ) ; // force close
320+ } , 1000 ) ;
321+ return ;
322+ }
314323 // try a cache reset
315324 if ( window . _resetCacheIfNeeded ) {
316325 window . _resetCacheIfNeeded ( true )
@@ -341,7 +350,9 @@ async function _recoverOnFailure(err) {
341350 'Critical error when loading brackets. Trying to reload again.' ) ;
342351 const restartedOnce = sessionStorage . getItem ( SESSION_RESTART_ONCE_DUE_TO_CRITICAL_ERROR ) ;
343352 let shouldRestart ;
344- if ( ! restartedOnce ) {
353+ // In native apps, we can't auto-restart because the AES trust ring won't survive a reload
354+ // without proper dismantling. Always show confirmation dialog for native apps.
355+ if ( ! restartedOnce && ! Phoenix . isNativeApp ) {
345356 sessionStorage . setItem ( SESSION_RESTART_ONCE_DUE_TO_CRITICAL_ERROR , "true" ) ;
346357 shouldRestart = true ;
347358 } else {
0 commit comments