Revision 53741
Added by Konstantina Galouni almost 6 years ago
manage-user-notifications.component.ts | ||
---|---|---|
165 | 165 |
} |
166 | 166 |
|
167 | 167 |
*/ |
168 |
this.mailPrefs.restoreNotification(0); |
|
168 |
if(!Session.isLoggedIn()){ |
|
169 |
console.info(this._router.url); |
|
170 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
171 |
} else { |
|
172 |
this.mailPrefs.restoreNotification(0); |
|
169 | 173 |
|
170 |
if(this.userNotifications && this.initialUserNotifications) { |
|
171 |
this.successfulSaveMessage = ""; |
|
172 |
this.showLoading = true; |
|
173 |
this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications )); |
|
174 |
this.showLoading = false; |
|
175 |
} |
|
174 |
if(this.userNotifications && this.initialUserNotifications) {
|
|
175 |
this.successfulSaveMessage = "";
|
|
176 |
this.showLoading = true;
|
|
177 |
this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications ));
|
|
178 |
this.showLoading = false;
|
|
179 |
}
|
|
176 | 180 |
|
177 | 181 |
|
178 |
this.resetChange(); |
|
182 |
this.resetChange(); |
|
183 |
} |
|
179 | 184 |
} |
180 | 185 |
|
181 | 186 |
public changeValueForNewManagers(notifyForManagers : any) { |
187 |
if(!Session.isLoggedIn()){ |
|
188 |
console.info(this._router.url); |
|
189 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
190 |
} else { |
|
182 | 191 |
this.userNotifications.notifyForNewManagers = !notifyForManagers; |
183 | 192 |
this.change(); |
193 |
} |
|
184 | 194 |
} |
185 | 195 |
|
186 | 196 |
public changeValueForNewSubscribers(notifyForSubscribers : any) { |
197 |
if(!Session.isLoggedIn()){ |
|
198 |
console.info(this._router.url); |
|
199 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
200 |
} else { |
|
187 | 201 |
this.userNotifications.notifyForNewSubscribers = !notifyForSubscribers; |
188 | 202 |
this.change(); |
203 |
} |
|
189 | 204 |
} |
190 | 205 |
|
191 | 206 |
private change() { |
... | ... | |
203 | 218 |
} |
204 | 219 |
|
205 | 220 |
public mailPrefsChanged(): boolean { |
206 |
return this.mailPrefs.prefsChanged["0"];//(0); |
|
221 |
if(!Session.isLoggedIn()){ |
|
222 |
console.info(this._router.url); |
|
223 |
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); |
|
224 |
} else { |
|
225 |
return this.mailPrefs.prefsChanged["0"];//(0); |
|
226 |
} |
|
207 | 227 |
} |
208 | 228 |
|
209 | 229 |
handleUpdateError(message: string, error) { |
Also available in: Unified diff
manage-subscribers.component & manage-user-notifications.component: when Session is expired, redirect to '/user-info' page to show a proper message (fix unhandled cases).