@@ -174,55 +174,50 @@ const Router = () => {
174
174
}
175
175
176
176
const abortController = new AbortController ( )
177
- if ( pageSpec . getInitialProps != null ) {
178
- Promise . all ( [
179
- initialized ? null : getGlobalData ( ) ,
180
- pageSpec . getInitialProps ( {
181
- pathname,
182
- search,
183
- signal : abortController . signal ,
184
- } ) ,
185
- ] )
186
- . then ( ( [ globalData , pageData ] ) => {
187
- if ( globalData != null ) {
188
- initGlobalData ( globalData )
189
- }
190
- setPageInfo ( {
191
- Component : pageSpec . Component ,
192
- pageProps : pageData ,
177
+
178
+ Promise . all ( [
179
+ initialized ? null : getGlobalData ( ) ,
180
+ pageSpec . getInitialProps != null
181
+ ? pageSpec . getInitialProps ( {
182
+ pathname,
183
+ search,
184
+ signal : abortController . signal ,
193
185
} )
194
- nProgress . done ( )
186
+ : { } ,
187
+ ] )
188
+ . then ( ( [ globalData , pageData ] ) => {
189
+ if ( globalData != null ) {
190
+ initGlobalData ( globalData )
191
+ }
192
+ setPageInfo ( {
193
+ Component : pageSpec . Component ,
194
+ pageProps : pageData ,
195
195
} )
196
- . catch ( ( error : Error ) => {
197
- if ( error . name === 'AbortError' ) {
198
- console . warn ( 'Navigation aborted' )
199
- console . warn ( error )
200
- } else {
201
- console . error ( error )
202
- if ( ! initialized ) {
203
- initGlobalData ( {
204
- teams : [ ] ,
205
- invites : [ ] ,
206
- } )
207
- }
208
-
209
- setPageInfo ( {
210
- isError : true ,
211
- Component : ErrorPage ,
212
- pageProps : {
213
- error,
214
- } ,
196
+ nProgress . done ( )
197
+ } )
198
+ . catch ( ( error : Error ) => {
199
+ if ( error . name === 'AbortError' ) {
200
+ console . warn ( 'Navigation aborted' )
201
+ console . warn ( error )
202
+ } else {
203
+ console . error ( error )
204
+ if ( ! initialized ) {
205
+ initGlobalData ( {
206
+ teams : [ ] ,
207
+ invites : [ ] ,
215
208
} )
216
- nProgress . done ( )
217
209
}
218
- } )
219
- } else {
220
- setPageInfo ( {
221
- Component : pageSpec . Component ,
222
- pageProps : { } ,
210
+
211
+ setPageInfo ( {
212
+ isError : true ,
213
+ Component : ErrorPage ,
214
+ pageProps : {
215
+ error,
216
+ } ,
217
+ } )
218
+ nProgress . done ( )
219
+ }
223
220
} )
224
- nProgress . done ( )
225
- }
226
221
227
222
intercom . update ( )
228
223
0 commit comments