|
|
@ -125,7 +125,10 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
this.dataSource = new MatTableDataSource(activities); |
|
|
|
this.totalItems = count; |
|
|
|
|
|
|
|
if (this.hasPermissionToCreateActivity && this.totalItems <= 0) { |
|
|
|
if ( |
|
|
|
this.hasPermissionToCreateActivity && |
|
|
|
this.user?.activitiesCount === 0 |
|
|
|
) { |
|
|
|
this.router.navigate([], { queryParams: { createDialog: true } }); |
|
|
|
} |
|
|
|
|
|
|
@ -160,6 +163,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
}) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(() => { |
|
|
|
this.userService |
|
|
|
.get(true) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(); |
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
}); |
|
|
|
} |
|
|
@ -169,6 +177,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
.deleteActivity(aId) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(() => { |
|
|
|
this.userService |
|
|
|
.get(true) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(); |
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
}); |
|
|
|
} |
|
|
@ -230,6 +243,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
.afterClosed() |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(() => { |
|
|
|
this.userService |
|
|
|
.get(true) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(); |
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
}); |
|
|
|
} |
|
|
@ -248,6 +266,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
.afterClosed() |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(() => { |
|
|
|
this.userService |
|
|
|
.get(true) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(); |
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
}); |
|
|
|
} |
|
|
@ -333,6 +356,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit { |
|
|
|
if (transaction) { |
|
|
|
this.dataService.postOrder(transaction).subscribe({ |
|
|
|
next: () => { |
|
|
|
this.userService |
|
|
|
.get(true) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe(); |
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
|
} |
|
|
|
}); |
|
|
|