diff --git a/src/app/components/stream/user-profile/user-profile.component.html b/src/app/components/stream/user-profile/user-profile.component.html index 1c332ad8..49d0528a 100644 --- a/src/app/components/stream/user-profile/user-profile.component.html +++ b/src/app/components/stream/user-profile/user-profile.component.html @@ -21,7 +21,7 @@ class="waiting-icon profile-header__follow--waiting"> -
+
+
+ +
@@ -68,7 +73,7 @@ class="waiting-icon profile-header__follow--waiting"> -
+
+
+ +
diff --git a/src/app/components/stream/user-profile/user-profile.component.ts b/src/app/components/stream/user-profile/user-profile.component.ts index e0701be3..4cbd9f6a 100644 --- a/src/app/components/stream/user-profile/user-profile.component.ts +++ b/src/app/components/stream/user-profile/user-profile.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core'; import { HttpErrorResponse } from '@angular/common/http'; -import { faUser, faHourglassHalf, faUserCheck } from "@fortawesome/free-solid-svg-icons"; +import { faUser, faHourglassHalf, faUserCheck, faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"; import { faUser as faUserRegular } from "@fortawesome/free-regular-svg-icons"; import { Observable, Subscription } from 'rxjs'; import { Store } from '@ngxs/store'; @@ -26,6 +26,7 @@ export class UserProfileComponent implements OnInit { faUserRegular = faUserRegular; faHourglassHalf = faHourglassHalf; faUserCheck = faUserCheck; + faExclamationTriangle = faExclamationTriangle; displayedAccount: Account; hasNote: boolean; @@ -34,6 +35,7 @@ export class UserProfileComponent implements OnInit { isLoading: boolean; loadingRelationShip = false; + relationShipError = false; showFloatingHeader = false; showFloatingStatusMenu = false; @@ -101,12 +103,14 @@ export class UserProfileComponent implements OnInit { const userAccount = accounts.filter(x => x.isSelected)[0]; this.loadingRelationShip = true; + this.relationShipError = false; this.toolsService.findAccount(userAccount, this.lastAccountName) .then((account: Account) => { return this.getFollowStatus(userAccount, account); }) .catch((err: HttpErrorResponse) => { - this.notificationService.notifyHttpError(err, userAccount); + console.error(err); + this.relationShipError = true; }) .then(() => { this.loadingRelationShip = false; @@ -153,12 +157,6 @@ export class UserProfileComponent implements OnInit { this.currentlyUsedAccount = this.toolsService.getSelectedAccounts()[0]; return this.toolsService.findAccount(this.currentlyUsedAccount, this.lastAccountName) - // .then((account: Account) => { - // if(account != null) return account; - - // let fullName = `https://${this.lastAccountName.split('@')[2]}/@${this.lastAccountName.split('@')[1]}`; - // return this.toolsService.findAccount(this.currentlyUsedAccount, fullName); - // }) .then((account: Account) => { this.isLoading = false; this.statusLoading = true; @@ -176,7 +174,7 @@ export class UserProfileComponent implements OnInit { return Promise.all([getFollowStatusPromise, getStatusesPromise, getPinnedStatusesPromise]); }) .catch((err: HttpErrorResponse) => { - //this.notificationService.notifyHttpError(err, this.currentlyUsedAccount); + console.error(err); }) .then(() => { this.isLoading = false; diff --git a/src/app/services/tools.service.ts b/src/app/services/tools.service.ts index bae15c27..4778dd3a 100644 --- a/src/app/services/tools.service.ts +++ b/src/app/services/tools.service.ts @@ -129,11 +129,8 @@ export class ToolsService { return findAccountFunc(results); }) .then((foundAccount: Account) => { - console.warn(accountName); - if (foundAccount != null) return Promise.resolve(foundAccount); - console.error('tada'); let fullName = `https://${accountName.split('@')[1]}/@${accountName.split('@')[0]}`; return this.mastodonService.search(account, fullName, searchVersion, true) .then((results: Results) => {