MOBILE-3833 forum: Do not display empty card on response posts if none

main
Pau Ferrer Ocaña 2022-04-06 16:22:47 +02:00
parent 9624105319
commit 2ece8e7e7e
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@
</addon-mod-forum-post>
</div>
<ion-card *ngIf="sort != 'nested'">
<ion-card *ngIf="sort != 'nested' && posts.length">
<ng-container *ngFor="let post of posts; first as first">
<core-spacer *ngIf="!first"></core-spacer>
<addon-mod-forum-post [post]="post" [courseId]="courseId" [discussionId]="discussionId" [component]="component"
@ -103,7 +103,7 @@
</ng-container>
</ion-card>
<ng-container *ngIf="sort == 'nested'">
<ng-container *ngIf="sort == 'nested' && posts.length">
<ng-container *ngFor="let post of posts">
<ng-container *ngTemplateOutlet="nestedPosts; context: {post: post}"></ng-container>
</ng-container>

View File

@ -75,7 +75,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
discussion?: AddonModForumDiscussion;
discussions?: AddonModForumDiscussionDiscussionsSwipeManager;
startingPost?: Post;
posts!: Post[];
posts: Post[] = [];
discussionLoaded = false;
postSubjects!: { [id: string]: string };
isOnline!: boolean;