Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit79229fc41cb55c68e195ccee6d0488acabeff3c4 (patch)
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
Filese7b95f6e5450efe90e15910153c0a63a950fe555 /src
DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.tar
DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.tar.gz
DevHive-Angular-79229fc41cb55c68e195ccee6d0488acabeff3c4.zip
Parent7213d280eac242e8df5403120f59742fb1855a24 (diff)
Made posts not update at all of the new message is blank (to be consistent with comment page)
1 files changed, 2 insertions, 5 deletions
-rw-r--r--src/app/components/post-page/post-page.component.ts7
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();