added loading animation for thread loading
This commit is contained in:
parent
2970dfd8d8
commit
8624a2f954
|
@ -1,6 +1,9 @@
|
|||
<div class="stream-toots flexcroll" #statusstream (scroll)="onScroll()">
|
||||
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>
|
||||
|
||||
<!-- data-simplebar -->
|
||||
<div class="stream-toots__status" *ngFor="let statusWrapper of statuses">
|
||||
<app-status [statusWrapper]="statusWrapper" (browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)"></app-status>
|
||||
<app-status [statusWrapper]="statusWrapper" (browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
|
||||
(browseThreadEvent)="browseThread($event)"></app-status>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -16,6 +16,7 @@ import { StatusWrapper } from '../stream.component';
|
|||
styleUrls: ['./stream-statuses.component.scss']
|
||||
})
|
||||
export class StreamStatusesComponent implements OnInit, OnDestroy {
|
||||
private isLoading = false; //TODO
|
||||
|
||||
private _streamElement: StreamElement;
|
||||
private account: AccountInfo;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<p>
|
||||
thread works!
|
||||
|
||||
{{ thread }}
|
||||
</p>
|
|
@ -11,6 +11,7 @@ import { Status, Results, Context } from '../../../services/models/mastodon.inte
|
|||
})
|
||||
export class ThreadComponent implements OnInit {
|
||||
statuses: StatusWrapper[] = [];
|
||||
private isLoading: boolean;
|
||||
|
||||
@Output() browseAccountEvent = new EventEmitter<string>();
|
||||
@Output() browseHashtagEvent = new EventEmitter<string>();
|
||||
|
@ -19,6 +20,7 @@ export class ThreadComponent implements OnInit {
|
|||
@Input('currentThread')
|
||||
set currentThread(thread: string) {
|
||||
if (thread) {
|
||||
this.isLoading = true;
|
||||
this.getThread(thread);
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +43,7 @@ export class ThreadComponent implements OnInit {
|
|||
const retrievedStatus = result.statuses[0];
|
||||
this.mastodonService.getStatusContext(currentAccount, retrievedStatus.id)
|
||||
.then((context: Context) => {
|
||||
this.isLoading = false;
|
||||
let contextStatuses = [...context.ancestors, retrievedStatus, ...context.descendants]
|
||||
|
||||
for (const s of contextStatuses) {
|
||||
|
@ -50,6 +53,7 @@ export class ThreadComponent implements OnInit {
|
|||
});
|
||||
} else {
|
||||
//TODO handle error
|
||||
this.isLoading = false;
|
||||
console.error('could not retrieve status');
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue