diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-25 14:27:15 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-25 14:27:15 +0200 |
| commit | 79229fc41cb55c68e195ccee6d0488acabeff3c4 (patch) | |
| tree | e7b95f6e5450efe90e15910153c0a63a950fe555 /src/app/components/post-page/post-page.component.ts | |
| parent | 7213d280eac242e8df5403120f59742fb1855a24 (diff) | |
| download | DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.tar DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.tar.gz DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.zip | |
Made posts not update at all of the new message is blank (to be consistent with comment page)
Diffstat (limited to 'src/app/components/post-page/post-page.component.ts')
| -rw-r--r-- | src/app/components/post-page/post-page.component.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index 648048b..3218a19 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -116,12 +116,9 @@ export class PostPageComponent implements OnInit { } if (this.editingPost) { - let newMessage = this.editPostFormGroup.get('newPostMessage')?.value; + const newMessage = this.editPostFormGroup.get('newPostMessage')?.value; - if (newMessage !== this.post.message) { - if (newMessage === '') { - newMessage = this.post.message; - } + if (newMessage === '' && newMessage !== this.post.message) { this._postService.putPostWithSessionStorageRequest(this.postId, newMessage, this.files).subscribe( (result: object) => { this.reloadPage(); |
