From 44712c5f9825eca6cb38ed5351f5fa33fc8d107e Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Mon, 11 May 2020 10:04:38 +1000 Subject: [PATCH] FIX: ESC to dismiss empty draft topic composer Previously originalTitle was set to undefined leading to titleDirty being unconditionally undefined for new topics That mean you could not dismiss the composer via ESC --- app/assets/javascripts/discourse/app/models/composer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.js index 56e4d1ac806..211e4ca93dd 100644 --- a/app/assets/javascripts/discourse/app/models/composer.js +++ b/app/assets/javascripts/discourse/app/models/composer.js @@ -785,11 +785,14 @@ const Composer = RestModel.extend({ }); } + this.set("originalTitle", ""); + if (opts.title) { this.set("title", opts.title); } this.set("originalText", opts.draft ? "" : this.reply); + if (this.editingFirstPost) { this.set("originalTitle", this.title); }