1
0
mirror of https://github.com/NicolasConstant/sengi synced 2025-02-08 07:58:47 +01:00

added loading animation

This commit is contained in:
Nicolas Constant 2019-11-20 23:50:58 -05:00
parent 52f5aa69df
commit 7ee5cdb4f1
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 6 additions and 3 deletions

View File

@ -14,7 +14,7 @@
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
</app-notification>
</div>
<app-waiting-animation *ngIf="isNotificationsLoading" class="waiting-icon"></app-waiting-animation>
</div>
<div [class.notifications__elements__wrapper--selected]="displayingMentions"
class="notifications__elements__wrapper flexcroll" #mentionstream (scroll)="onScroll()" tabindex="0">
@ -23,6 +23,7 @@
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
</app-notification>
</div>
<app-waiting-animation *ngIf="isMentionsLoading" class="waiting-icon"></app-waiting-animation>
</div>
</div>
</div>

View File

@ -44,7 +44,7 @@ export class StreamNotificationsComponent implements OnInit, OnDestroy {
mentionsMaxReached: boolean;
lastMentionId: string;
isNotificationsLoading: boolean;
isNotificationsLoading: boolean = true;
notificationsMaxReached: boolean;
lastNotificationId: string;
@ -124,11 +124,13 @@ export class StreamNotificationsComponent implements OnInit, OnDestroy {
this.mastodonService.getNotifications(this.account, null, null, null, 10)
.then((notifications: Notification[]) => {
this.notifications = notifications.map(x => new NotificationWrapper(x, this.account));
this.isNotificationsLoading = false;
this.notifications = notifications.map(x => new NotificationWrapper(x, this.account));
this.lastNotificationId = this.notifications[this.notifications.length - 1].notification.id;
})
.catch(err => {
this.isNotificationsLoading = false;
})
.then(() => {
let streamElement = new StreamElement(StreamTypeEnum.personnal, 'activity', this.account.id, null, null, null, this.account.instance);