From 256c883f57df44766595494c45475588bf00721a Mon Sep 17 00:00:00 2001
From: Noel De Martin <noel@moodle.com>
Date: Tue, 26 Nov 2019 16:16:13 +0100
Subject: [PATCH] MOBILE-3230 forum: Avoid updating reply subject if it's been
 modified

---
 src/addon/mod/forum/components/post/post.ts | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/addon/mod/forum/components/post/post.ts b/src/addon/mod/forum/components/post/post.ts
index 97b599cef..16aedbeb5 100644
--- a/src/addon/mod/forum/components/post/post.ts
+++ b/src/addon/mod/forum/components/post/post.ts
@@ -291,8 +291,13 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy {
         } else {
             // The post being replied has changed but the data will be kept.
             this.replyData.replyingTo = this.post.id;
-            this.replyData.subject = this.defaultReplySubject;
-            this.originalData.subject = this.defaultReplySubject;
+
+            if (this.replyData.subject == this.originalData.subject) {
+                // Update subject only if it hadn't been modified
+                this.replyData.subject = this.defaultReplySubject;
+                this.originalData.subject = this.defaultReplySubject;
+            }
+
             this.messageControl.setValue(this.replyData.message);
         }