Skip to content

Commit

Permalink
feat(workflows): u#2860 t#4036 toast permissions lost
Browse files Browse the repository at this point in the history
  • Loading branch information
cocotime committed Sep 29, 2023
1 parent 423316f commit 1196cd2
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,18 @@ export class ProjectFeatureShellComponent implements OnDestroy, AfterViewInit {
this.wsService.projectEvents('projectroles.update')
)
.pipe(untilDestroyed(this))
.subscribe(() => {
.subscribe((data) => {
const content = data.event.content as { membership: Membership };
if (!content.membership.role.isAdmin) {
this.appService.toastNotification({
message: 'errors.admin_permission',
paramsMessage: {
project: content.membership.project?.name,
},
status: TuiNotification.Error,
closeOnNavigation: false,
});
}
this.store.dispatch(
permissionsUpdate({ id: this.state.get('project').id })
);
Expand Down

0 comments on commit 1196cd2

Please sign in to comment.