@@ -719,28 +719,27 @@ ipcMain.once('frontendReady', async () => {
719
719
logInfo ( 'Frontend Ready' , LogPrefix . Backend )
720
720
const currentVersion = app . getVersion ( )
721
721
const lastVersion = configStore . get ( 'appVersion' , '' )
722
+ const walletStateIsConnected = configStore . get (
723
+ 'walletState.isConnected' ,
724
+ false
725
+ )
722
726
723
- if ( ! lastVersion || lastVersion !== currentVersion ) {
724
- // Only initialize extension and reload if a wallet is connected
725
- const walletStateIsConnected = configStore . get (
726
- 'walletState.isConnected' ,
727
- false
727
+ await initExtension ( hpApi )
728
+
729
+ // Only reload the app if a wallet is not connected
730
+ // or the app version has changed
731
+ if (
732
+ ! walletStateIsConnected ||
733
+ ! lastVersion ||
734
+ lastVersion !== currentVersion
735
+ ) {
736
+ logInfo (
737
+ 'App version changed and wallet connected, reloading to update MM' ,
738
+ LogPrefix . Backend
728
739
)
729
- if ( walletStateIsConnected ) {
730
- logInfo (
731
- 'App version changed and wallet connected, reloading to update MM' ,
732
- LogPrefix . Backend
733
- )
734
- await initExtension ( hpApi )
735
- // wait for mm SW to initialize
736
- await wait ( 5000 )
737
- ipcMain . emit ( 'reloadApp' )
738
- } else {
739
- logInfo (
740
- 'App version changed but no wallet connected, skipping MM update' ,
741
- LogPrefix . Backend
742
- )
743
- }
740
+ // wait for mm SW to initialize
741
+ await wait ( 5000 )
742
+ ipcMain . emit ( 'reloadApp' )
744
743
}
745
744
746
745
handleProtocol ( [ openUrlArgument , ...process . argv ] )
0 commit comments