diff --git a/apps/web-mzima-client/src/app/post/post-details/post-details.component.ts b/apps/web-mzima-client/src/app/post/post-details/post-details.component.ts index 6eb0352fe3..4137cbf728 100644 --- a/apps/web-mzima-client/src/app/post/post-details/post-details.component.ts +++ b/apps/web-mzima-client/src/app/post/post-details/post-details.component.ts @@ -117,21 +117,17 @@ export class PostDetailsComponent extends BaseComponent implements OnChanges, On private async getPost(id: number): Promise { if (!this.postId) return; this.post = await this.getPostInformation(id); - if (this.post?.form_id) { + if (this.post && this.post.form_id) { const form = await lastValueFrom(this.surveyService.getById(this.post.form_id!)); this.post.form = form.result; + this.getData(this.post); + this.preparePostForView(); + } else { + this.postChanged = false; } - this.getData(this.post); - this.preparePostForView(); - //---------------------- - //---------------------- } private async getData(post: PostResult): Promise { - if (!post.form_id) { - this.postChanged = false; - return; - } for (const content of post.post_content as PostContent[]) { this.preparingSafeVideoUrls(content.fields); this.preparingRelatedPosts(content.fields);