@@ -125,29 +125,32 @@ class ArcInit {
125
125
}
126
126
this . initConfig = initConfig ;
127
127
window . ArcConfig . initConfig = initConfig ;
128
- await this . initApp ( ) ;
129
- await this . upgradeApp ( ) ;
128
+
129
+ let cnf ;
130
+ try {
131
+ cnf = await this . prefProxy . load ( ) ;
132
+ await this . _createApp ( cnf ) ;
133
+ } catch ( e ) {
134
+ this . reportFatalError ( e ) ;
135
+ throw e ;
136
+ }
137
+
138
+ await this . initApp ( cnf ) ;
139
+ await this . upgradeApp ( cnf ) ;
130
140
await this . processInitialPath ( ) ;
131
141
await this . removeLoader ( ) ;
132
142
console . log ( 'Application window is now ready.' ) ;
133
143
}
134
144
/**
135
145
* Initialized the application when window is ready.
136
146
*
147
+ * @param {Object } cnf Current qapplication configuration
137
148
* @return {Promise }
138
149
*/
139
- async initApp ( ) {
150
+ async initApp ( cnf ) {
140
151
// console.info('Initializing renderer window...');
141
152
this . workspaceManager = new WorkspaceManager ( this . initConfig . workspaceFile ) ;
142
153
this . workspaceManager . observe ( ) ;
143
- let cnf ;
144
- try {
145
- cnf = await this . prefProxy . load ( ) ;
146
- await this . _createApp ( cnf ) ;
147
- } catch ( e ) {
148
- this . reportFatalError ( e ) ;
149
- throw e ;
150
- }
151
154
if ( this . initConfig . darkMode ) {
152
155
cnf . theme = '@advanced-rest-client/arc-electron-dark-theme' ;
153
156
}
@@ -431,8 +434,7 @@ class ArcInit {
431
434
} , 150 ) ;
432
435
}
433
436
434
- async upgradeApp ( ) {
435
- const cnf = await this . prefProxy . load ( ) ;
437
+ async upgradeApp ( cnf ) {
436
438
const inst = new UpgradeHelper ( cnf . upgrades ) ;
437
439
const upgrades = inst . getUpgrades ( ) ;
438
440
if ( ! upgrades || upgrades . length === 0 ) {
0 commit comments