Skip to content

Commit

Permalink
Handle isLoading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Jan 6, 2025
1 parent e444d7f commit 0de9e41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<mat-toolbar>
<button mat-icon-button (click)="goBack()"><mat-icon>arrow_back</mat-icon></button>
<span *ngIf="!isLoading">
<span *ngIf="achievementNotFound" i18n>Add Achievements</span>
<span *ngIf="!achievementNotFound" i18n>Edit Achievements</span>
</span>
<button mat-icon-button (click)="goBack()"><mat-icon>arrow_back</mat-icon></button>
<span *ngIf="achievementNotFound" i18n>Add Achievements</span>
<span *ngIf="!achievementNotFound" i18n>Edit Achievements</span>
</mat-toolbar>

<div class="planet-users-achievements-update space-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
docInfo = { '_id': this.user._id + '@' + this.configuration.code, '_rev': undefined };
readonly dbName = 'achievements';
achievementNotFound = false;
isLoading = true;
editForm: FormGroup;
profileForm: FormGroup;
private onDestroy$ = new Subject<void>();
Expand Down Expand Up @@ -64,7 +63,6 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
catchError(() => this.usersAchievementsService.getAchievements(this.user._id))
)
.subscribe((achievements) => {
this.isLoading = false;
this.editForm.patchValue(achievements);
this.editForm.controls.achievements = this.fb.array(achievements.achievements || []);
this.editForm.controls.references = this.fb.array(achievements.references || []);
Expand All @@ -78,7 +76,6 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
}, (error) => {
console.log(error);
this.achievementNotFound = true;
this.isLoading = false;
});

this.planetStepListService.stepMoveClick$.pipe(takeUntil(this.onDestroy$)).subscribe(
Expand Down

0 comments on commit 0de9e41

Please sign in to comment.