From a7aa0b3d967b5190cc4ba84c014b5566165d6461 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 3 Feb 2021 10:45:10 +0200 Subject: Fixed post page loading, when there are no attachments --- .../src/app/components/post-page/post-page.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts index 3991870..7402cc0 100644 --- a/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts +++ b/src/DevHive.Angular/src/app/components/post-page/post-page.component.ts @@ -45,7 +45,12 @@ export class PostPageComponent implements OnInit { if (this.loggedIn) { this.editable = this.post.creatorUsername === this._tokenService.getUsernameFromSessionStorageToken(); } - this.loadFiles(); + if (this.post.fileURLs.length > 0) { + this.loadFiles(); + } + else { + this.dataArrived = true; + } }, (err: HttpErrorResponse) => { this._router.navigate(['/not-found']); -- cgit v1.2.3