From 882d123881fc52bbc4dfb166e5cf53662ee9ab6a Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Wed, 1 Jan 2020 19:09:02 +0100 Subject: [PATCH] added loading icon on login --- .../add-new-account/add-new-account.component.html | 3 ++- .../add-new-account/add-new-account.component.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/components/floating-column/add-new-account/add-new-account.component.html b/src/app/components/floating-column/add-new-account/add-new-account.component.html index 00274f15..f9e7f28d 100644 --- a/src/app/components/floating-column/add-new-account/add-new-account.component.html +++ b/src/app/components/floating-column/add-new-account/add-new-account.component.html @@ -7,7 +7,8 @@
- + +
diff --git a/src/app/components/floating-column/add-new-account/add-new-account.component.ts b/src/app/components/floating-column/add-new-account/add-new-account.component.ts index 1e43dba3..a79a40cb 100644 --- a/src/app/components/floating-column/add-new-account/add-new-account.component.ts +++ b/src/app/components/floating-column/add-new-account/add-new-account.component.ts @@ -20,6 +20,8 @@ export class AddNewAccountComponent implements OnInit { private instance: string; isComrade: boolean; + isLoading: boolean; + private _mastodonFullHandle: string; @Input() set mastodonFullHandle(value: string) { @@ -57,17 +59,20 @@ export class AddNewAccountComponent implements OnInit { } onSubmit(): boolean { - // let fullHandle = this.mastodonFullHandle.split('@').filter(x => x != null && x !== ''); - // const username = fullHandle[0]; - // const instance = fullHandle[1]; - this.checkBlockList(this.instance); + this.isLoading = true; this.checkAndCreateApplication(this.instance) .then((appData: AppData) => { this.redirectToInstanceAuthPage(this.username, this.instance, appData); }) + .then(x => { + setTimeout(() => { + this.isLoading = false; + }, 1000); + }) .catch((err: HttpErrorResponse) => { + this.isLoading = false; if (err instanceof HttpErrorResponse) { this.notificationService.notifyHttpError(err, null); } else if ((err).message === 'CORS') {