File tree 1 file changed +15
-8
lines changed
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -274,22 +274,29 @@ class ViewportController extends Controller {
274
274
/**
275
275
*
276
276
*/
277
- updateWidgets ( ) {
277
+ async updateWidgets ( ) {
278
278
let me = this ,
279
- stateProvider = me . getStateProvider ( ) ;
279
+ stateProvider = me . getStateProvider ( ) ,
280
+ response ;
281
+
282
+ // Timing issue inside dist/development => the namespace might not be registered yet
283
+ if ( ! Colors . backend ) {
284
+ await me . timeout ( 50 ) ;
285
+ me . updateWidgets ( )
286
+ } else {
287
+ response = await Colors . backend . ColorService . read ( {
288
+ amountColors : stateProvider . getData ( 'amountColors' ) ,
289
+ amountColumns : stateProvider . getData ( 'amountColumns' ) ,
290
+ amountRows : stateProvider . getData ( 'amountRows' )
291
+ } ) ;
280
292
281
- Colors . backend . ColorService . read ( {
282
- amountColors : stateProvider . getData ( 'amountColors' ) ,
283
- amountColumns : stateProvider . getData ( 'amountColumns' ) ,
284
- amountRows : stateProvider . getData ( 'amountRows' )
285
- } ) . then ( response => {
286
293
if ( ! me . isDestroyed ) {
287
294
let { data} = response ;
288
295
289
296
me . updateTable ( data . tableData ) ;
290
297
me . updateCharts ( data . summaryData )
291
298
}
292
- } )
299
+ }
293
300
}
294
301
}
295
302
You can’t perform that action at this time.
0 commit comments