diff --git a/src/app/pages/subscribers/manage-subscribers.component.ts b/src/app/pages/subscribers/manage-subscribers.component.ts index 971c4e0..6c15025 100644 --- a/src/app/pages/subscribers/manage-subscribers.component.ts +++ b/src/app/pages/subscribers/manage-subscribers.component.ts @@ -134,6 +134,10 @@ export class ManageSubscribersComponent implements OnInit { } filterData(row: any, query: string) { + if(!Session.isLoggedIn()){ + console.info(this._router.url); + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + } else { let returnValue: boolean = false; if(query) { @@ -150,6 +154,7 @@ export class ManageSubscribersComponent implements OnInit { } } return true; + } } filterQuery(data, query){ diff --git a/src/app/pages/usernotifications/manage-user-notifications.component.ts b/src/app/pages/usernotifications/manage-user-notifications.component.ts index 9e2a757..1dea634 100644 --- a/src/app/pages/usernotifications/manage-user-notifications.component.ts +++ b/src/app/pages/usernotifications/manage-user-notifications.component.ts @@ -165,27 +165,42 @@ export class ManageUserNotificationsComponent implements OnInit { } */ - this.mailPrefs.restoreNotification(0); + if(!Session.isLoggedIn()){ + console.info(this._router.url); + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + } else { + this.mailPrefs.restoreNotification(0); - if(this.userNotifications && this.initialUserNotifications) { - this.successfulSaveMessage = ""; - this.showLoading = true; - this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications )); - this.showLoading = false; + if(this.userNotifications && this.initialUserNotifications) { + this.successfulSaveMessage = ""; + this.showLoading = true; + this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications )); + this.showLoading = false; + } + + + this.resetChange(); } - - - this.resetChange(); } public changeValueForNewManagers(notifyForManagers : any) { + if(!Session.isLoggedIn()){ + console.info(this._router.url); + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + } else { this.userNotifications.notifyForNewManagers = !notifyForManagers; this.change(); + } } public changeValueForNewSubscribers(notifyForSubscribers : any) { + if(!Session.isLoggedIn()){ + console.info(this._router.url); + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + } else { this.userNotifications.notifyForNewSubscribers = !notifyForSubscribers; this.change(); + } } private change() { @@ -203,7 +218,12 @@ export class ManageUserNotificationsComponent implements OnInit { } public mailPrefsChanged(): boolean { - return this.mailPrefs.prefsChanged["0"];//(0); + if(!Session.isLoggedIn()){ + console.info(this._router.url); + this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + } else { + return this.mailPrefs.prefsChanged["0"];//(0); + } } handleUpdateError(message: string, error) {