@@ -403,7 +403,7 @@ export class MachinesPageComponent implements OnInit, OnDestroy {
403
403
_changeMachineAuthorization ( machine : Machine , authorized : boolean , machinesTable : Table ) {
404
404
// Block table UI when machine authorization is in progress.
405
405
this . dataLoading = true
406
- const state_backup = machine . authorized
406
+ const stateBackup = machine . authorized
407
407
408
408
machine . authorized = authorized
409
409
const prefix = authorized ? '' : 'un'
@@ -420,7 +420,7 @@ export class MachinesPageComponent implements OnInit, OnDestroy {
420
420
this . serverData . forceReloadAppsStats ( )
421
421
} ,
422
422
error : ( err ) => {
423
- machine . authorized = state_backup
423
+ machine . authorized = stateBackup
424
424
this . dataLoading = false
425
425
const msg = getErrorMessage ( err )
426
426
this . msgSrv . add ( {
@@ -641,13 +641,15 @@ export class MachinesPageComponent implements OnInit, OnDestroy {
641
641
// Calling servicesApi.updateMachine() API sequentially for all selected machines.
642
642
// Max expected count of selected machines is max machines per table page,
643
643
// which currently is 50.
644
- let authorizations$ : Observable < Machine > = concat ( )
644
+ const updateObservables : Observable < Machine > [ ] = [ ]
645
645
for ( const m of this . selectedMachines ) {
646
646
m . authorized = true
647
- // Use concat to call servicesApi sequentially.
648
- authorizations$ = concat ( authorizations$ , this . servicesApi . updateMachine ( m . id , m ) )
647
+ updateObservables . push ( this . servicesApi . updateMachine ( m . id , m ) )
649
648
}
650
649
650
+ // Use concat to call servicesApi sequentially.
651
+ const authorizations$ : Observable < Machine > = concat ( ...updateObservables )
652
+
651
653
// Block table UI when bulk machines authorization is in progress.
652
654
this . dataLoading = true
653
655
authorizations$ . subscribe ( {
0 commit comments