From 991064f8719c9d6a9ed750412279fa806577bf8a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 31 Jan 2021 11:13:50 +0200 Subject: Simplified goback functinality of profile and profile-settings components --- .../components/profile-settings/profile-settings.component.html | 2 +- .../app/components/profile-settings/profile-settings.component.ts | 8 -------- .../src/app/components/profile/profile.component.ts | 6 +----- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html index 1b713d7..c38a6d7 100644 --- a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html +++ b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html @@ -2,7 +2,7 @@

diff --git a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts index 3460842..769c1bb 100644 --- a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.ts @@ -235,14 +235,6 @@ export class ProfileSettingsComponent implements OnInit { this._router.navigate([this._router.url.substring(0, this._router.url.length - 9)]); } - goBack(): void { - const currURL = this._location.path(); - this._location.back(); - if (this._location.path() === currURL) { - this.goToProfile(); - } - } - logout(): void { this._tokenService.logoutUserFromSessionStorage(); this.goToProfile(); diff --git a/src/DevHive.Angular/src/app/components/profile/profile.component.ts b/src/DevHive.Angular/src/app/components/profile/profile.component.ts index 04e49f7..5dd965e 100644 --- a/src/DevHive.Angular/src/app/components/profile/profile.component.ts +++ b/src/DevHive.Angular/src/app/components/profile/profile.component.ts @@ -111,11 +111,7 @@ export class ProfileComponent implements OnInit { } goBack(): void { - const currURL = this._location.path(); - this._location.back(); - if (this._location.path() === currURL) { - this._router.navigate(['/']); - } + this._router.navigate(['/']); } navigateToSettings(): void { -- cgit v1.2.3