Commit 6a47f022ace01cf71b78f15b52809051cd358609

Authored by Igor Kulikov
1 parent a39fe0f3

Add new widgetContext field currentUser

@@ -58,6 +58,8 @@ import { @@ -58,6 +58,8 @@ import {
58 NotificationVerticalPosition 58 NotificationVerticalPosition
59 } from '@core/notification/notification.models'; 59 } from '@core/notification/notification.models';
60 import { ActionNotificationShow } from '@core/notification/notification.actions'; 60 import { ActionNotificationShow } from '@core/notification/notification.actions';
  61 +import { AuthUser } from '@shared/models/user.model';
  62 +import { getCurrentAuthUser } from '@core/auth/auth.selectors';
61 63
62 export interface IWidgetAction { 64 export interface IWidgetAction {
63 name: string; 65 name: string;
@@ -116,6 +118,14 @@ export class WidgetContext { @@ -116,6 +118,14 @@ export class WidgetContext {
116 this.changeDetectorValue = cd; 118 this.changeDetectorValue = cd;
117 } 119 }
118 120
  121 + get currentUser(): AuthUser {
  122 + if (this.store) {
  123 + return getCurrentAuthUser(this.store);
  124 + } else {
  125 + return null;
  126 + }
  127 + }
  128 +
119 private changeDetectorValue: ChangeDetectorRef; 129 private changeDetectorValue: ChangeDetectorRef;
120 130
121 inited = false; 131 inited = false;