diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-31 11:13:50 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-31 11:13:50 +0200 |
| commit | 991064f8719c9d6a9ed750412279fa806577bf8a (patch) | |
| tree | a622a54f60de0848a63f7c7f49277a4394951a5d /src | |
| parent | 7c92a4f97ea489f2401d9462bbcd867a1a10774d (diff) | |
| download | DevHive-991064f8719c9d6a9ed750412279fa806577bf8a.tar DevHive-991064f8719c9d6a9ed750412279fa806577bf8a.tar.gz DevHive-991064f8719c9d6a9ed750412279fa806577bf8a.zip | |
Simplified goback functinality of profile and profile-settings components
Diffstat (limited to 'src')
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 @@ <div id="content" *ngIf="dataArrived"> <nav id="navigation"> - <button class="submit-btn" (click)="goBack()">ᐊ Back</button> + <button class="submit-btn" (click)="goToProfile()">ᐊ Back</button> <button class="submit-btn" (click)="logout()">Logout</button> </nav> <hr> 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 { |
