@@ -125,7 +125,10 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
125
125
this . dataSource = new MatTableDataSource ( activities ) ;
126
126
this . totalItems = count ;
127
127
128
- if ( this . hasPermissionToCreateActivity && this . totalItems <= 0 ) {
128
+ if (
129
+ this . hasPermissionToCreateActivity &&
130
+ this . user ?. activitiesCount === 0
131
+ ) {
129
132
this . router . navigate ( [ ] , { queryParams : { createDialog : true } } ) ;
130
133
}
131
134
@@ -160,6 +163,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
160
163
} )
161
164
. pipe ( takeUntil ( this . unsubscribeSubject ) )
162
165
. subscribe ( ( ) => {
166
+ this . userService
167
+ . get ( true )
168
+ . pipe ( takeUntil ( this . unsubscribeSubject ) )
169
+ . subscribe ( ) ;
170
+
163
171
this . fetchActivities ( ) ;
164
172
} ) ;
165
173
}
@@ -169,6 +177,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
169
177
. deleteActivity ( aId )
170
178
. pipe ( takeUntil ( this . unsubscribeSubject ) )
171
179
. subscribe ( ( ) => {
180
+ this . userService
181
+ . get ( true )
182
+ . pipe ( takeUntil ( this . unsubscribeSubject ) )
183
+ . subscribe ( ) ;
184
+
172
185
this . fetchActivities ( ) ;
173
186
} ) ;
174
187
}
@@ -230,6 +243,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
230
243
. afterClosed ( )
231
244
. pipe ( takeUntil ( this . unsubscribeSubject ) )
232
245
. subscribe ( ( ) => {
246
+ this . userService
247
+ . get ( true )
248
+ . pipe ( takeUntil ( this . unsubscribeSubject ) )
249
+ . subscribe ( ) ;
250
+
233
251
this . fetchActivities ( ) ;
234
252
} ) ;
235
253
}
@@ -248,6 +266,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
248
266
. afterClosed ( )
249
267
. pipe ( takeUntil ( this . unsubscribeSubject ) )
250
268
. subscribe ( ( ) => {
269
+ this . userService
270
+ . get ( true )
271
+ . pipe ( takeUntil ( this . unsubscribeSubject ) )
272
+ . subscribe ( ) ;
273
+
251
274
this . fetchActivities ( ) ;
252
275
} ) ;
253
276
}
@@ -333,6 +356,11 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
333
356
if ( transaction ) {
334
357
this . dataService . postOrder ( transaction ) . subscribe ( {
335
358
next : ( ) => {
359
+ this . userService
360
+ . get ( true )
361
+ . pipe ( takeUntil ( this . unsubscribeSubject ) )
362
+ . subscribe ( ) ;
363
+
336
364
this . fetchActivities ( ) ;
337
365
}
338
366
} ) ;
0 commit comments