Revision 57548
Added by Konstantinos Triantafyllou over 4 years ago
subscribe.component.ts | ||
---|---|---|
66 | 66 |
} |
67 | 67 |
|
68 | 68 |
public ngOnInit() { |
69 |
this.route.data |
|
70 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
71 |
this.properties = data.envSpecific; |
|
72 |
if (typeof document !== 'undefined') { |
|
73 |
this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => { |
|
74 |
this.user = user; |
|
75 |
this.init(); |
|
76 |
}); |
|
77 |
} else { |
|
78 |
this.init(); |
|
79 |
} |
|
69 |
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { |
|
70 |
this.properties = data.envSpecific; |
|
71 |
this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => { |
|
72 |
this.user = user; |
|
73 |
this.init(); |
|
80 | 74 |
}); |
75 |
}); |
|
76 |
this.init(); |
|
81 | 77 |
} |
82 | 78 |
|
83 | 79 |
private init() { |
84 | 80 |
if (!this.showNumbers) { |
85 |
let email = (this.user)?this.user.email:null;
|
|
81 |
let email = (this.user) ? this.user.email : null;
|
|
86 | 82 |
if (email == null) { |
87 | 83 |
this.subscribed = false; |
88 | 84 |
} else { |
... | ... | |
128 | 124 |
} |
129 | 125 |
|
130 | 126 |
subscribe() { |
131 |
var email = (this.user)?this.user.email:null;
|
|
127 |
var email = (this.user) ? this.user.email : null;
|
|
132 | 128 |
if (email == null) { |
133 | 129 |
this.subscribed = false; |
134 | 130 |
// this.showLoginAlert = true; |
... | ... | |
190 | 186 |
} |
191 | 187 |
|
192 | 188 |
unsubscribe() { |
193 |
var email = (this.user)?this.user.email:null;
|
|
189 |
var email = (this.user) ? this.user.email : null;
|
|
194 | 190 |
if (email == null) { |
195 | 191 |
this.subscribed = false; |
196 | 192 |
} else { |
Also available in: Unified diff
[Connect]: Revert check if is Client. Added on UserInfo method.