mirror of
https://github.com/block-core/blockcore-notes.git
synced 2024-09-29 06:20:42 +00:00
Add exhausted calculation
This commit is contained in:
parent
fd5f65ba4c
commit
de2cb5e7fd
@ -25,8 +25,11 @@ export class UIService {
|
||||
|
||||
viewCounts = {
|
||||
followingEventsViewCount: 5,
|
||||
followingEventsViewExhausted: false,
|
||||
rootEventsViewCount: 5,
|
||||
rootEventsViewCountExhausted: false,
|
||||
replyEventsViewCount: 5,
|
||||
replyEventsViewCountExhausted: false,
|
||||
};
|
||||
|
||||
#unreadNotificationsChanged: BehaviorSubject<number> = new BehaviorSubject<number>(0);
|
||||
@ -249,18 +252,21 @@ export class UIService {
|
||||
updateRootEventsView(start: number, count: number) {
|
||||
this.viewCounts.rootEventsViewCount = count;
|
||||
this.#lists.rootEventsView = this.#lists.rootEvents.slice(start, count);
|
||||
this.viewCounts.rootEventsViewCountExhausted = count >= this.#lists.rootEvents.length;
|
||||
this.#rootEventsView.next(this.#lists.rootEventsView);
|
||||
}
|
||||
|
||||
updateReplyEventsView(start: number, count: number) {
|
||||
this.viewCounts.replyEventsViewCount = count;
|
||||
this.#lists.replyEventsView = this.#lists.replyEvents.slice(start, count);
|
||||
this.viewCounts.replyEventsViewCountExhausted = count >= this.#lists.replyEvents.length;
|
||||
this.#replyEventsView.next(this.#lists.replyEventsView);
|
||||
}
|
||||
|
||||
updateFollowingEventsView(start: number, count: number) {
|
||||
this.viewCounts.followingEventsViewCount = count;
|
||||
this.#lists.followingEventsView = this.#lists.followingEvents.slice(start, count);
|
||||
this.viewCounts.followingEventsViewExhausted = count >= this.#lists.followingEvents.length;
|
||||
this.#followingEventsView.next(this.#lists.followingEventsView);
|
||||
}
|
||||
|
||||
|
@ -57,8 +57,8 @@
|
||||
</div>
|
||||
|
||||
<div class="show-more centered">
|
||||
<button *ngIf="!ui.exhausted" mat-button (click)="showMore()">Show more...</button>
|
||||
<span *ngIf="ui.exhausted">Loading more events... or there are nothing more to show...</span>
|
||||
<button *ngIf="!ui.viewCounts.rootEventsViewCountExhausted" mat-button (click)="showMore()">Show more...</button>
|
||||
<span *ngIf="ui.viewCounts.rootEventsViewCountExhausted">Loading more events... or there are nothing more to show...</span>
|
||||
</div>
|
||||
</mat-tab>
|
||||
<mat-tab label="Replies">
|
||||
@ -82,7 +82,8 @@
|
||||
</div>
|
||||
|
||||
<div class="show-more centered">
|
||||
<button mat-button (click)="showMore()">Show more...</button>
|
||||
<button *ngIf="!ui.viewCounts.replyEventsViewCountExhausted" mat-button (click)="showMore()">Show more...</button>
|
||||
<span *ngIf="ui.viewCounts.replyEventsViewCountExhausted">Loading more events... or there are nothing more to show...</span>
|
||||
</div>
|
||||
</mat-tab>
|
||||
<!-- <mat-tab label="Likes">
|
||||
|
Loading…
Reference in New Issue
Block a user