Skip to content

Commit

Permalink
NAS-133675: Listen for cloudbackup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
denysbutenko committed Feb 8, 2025
1 parent b728798 commit d19eb36
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AsyncPipe } from '@angular/common';
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, input,
ChangeDetectionStrategy, ChangeDetectorRef, Component, effect, input,
output,
signal,
} from '@angular/core';
Expand Down Expand Up @@ -134,7 +134,14 @@ export class CloudBackupListComponent {
private snackbar: SnackbarService,
private appLoader: AppLoaderService,
protected emptyService: EmptyService,
) {}
) {
effect(() => {
if (!this.cloudBackups().length) {
this.dataProvider().expandedRow = null;
this.cdr.markForCheck();
}
});
}

runNow(row: CloudBackup): void {
this.dialogService.confirm({
Expand Down Expand Up @@ -193,9 +200,6 @@ export class CloudBackupListComponent {
).subscribe({
next: () => {
this.dataProvider().load();
if (!this.cloudBackups().length) {
this.dataProvider().expandedRow = null;
}
},
error: (err: unknown) => {
this.dialogService.error(this.errorHandler.parseError(err));
Expand Down

0 comments on commit d19eb36

Please sign in to comment.