File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 Component ,
77 Inject ,
88 OnDestroy ,
9+ OnInit ,
910} from '@angular/core' ;
1011import { Router } from '@angular/router' ;
1112import {
@@ -24,6 +25,7 @@ import {
2425} from 'rxjs' ;
2526import {
2627 catchError ,
28+ share ,
2729 switchMap ,
2830 take ,
2931} from 'rxjs/operators' ;
@@ -58,7 +60,7 @@ import { ContextMenuEntryType } from '../context-menu-entry-type';
5860 BtnDisabledDirective ,
5961 ] ,
6062} )
61- export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent implements OnDestroy {
63+ export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent implements OnInit , OnDestroy {
6264
6365 canCreateCorrection$ : Observable < boolean > ;
6466 /**
@@ -101,6 +103,14 @@ export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent im
101103 super ( injectedContextMenuObject , injectedContextMenuObjectType , ContextMenuEntryType . RequestCorrection ) ;
102104 }
103105
106+
107+ ngOnInit ( ) : void {
108+ this . canCreateCorrection$ = this . notificationService . claimedProfile . pipe (
109+ switchMap ( ( ) => this . canCreateCorrection ( false ) ) ,
110+ share ( ) ,
111+ ) ;
112+ }
113+
104114 /**
105115 * Open modal
106116 *
@@ -136,10 +146,6 @@ export class RequestCorrectionMenuComponent extends ContextMenuEntryComponent im
136146 this . router . navigate ( [ 'workspaceitems' , response . id , 'edit' ] ) ;
137147 }
138148 } ) ;
139-
140- this . canCreateCorrection$ = this . notificationService . claimedProfile . pipe (
141- switchMap ( ( ) => this . canCreateCorrection ( false ) ) ,
142- ) ;
143149 }
144150
145151 /**
You can’t perform that action at this time.
0 commit comments