mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 16:50:46 +08:00
In the past we have always relied on automatically opening the composer and auto loading the existing draft when visiting a topic that has a draft post reply. This is fine to auto load the draft, but when the composer is closed and reopened on the same page then we have an issue. The result is that the draft is then deleted because the draft key is set and the composer body is blank, since it has never been populated when clicking the reply to post button. To solve this we can check for existing drafts when clicking the reply to post button, then load the draft into the composer. _The challenging part of this change is that we have a number of tests that were relying on a false positive. Hence in the specs I have switched some tests to use a fixture that does not have drafts and in some cases kept the same fixture but mocked the response as having no drafts returned._ |
||
|---|---|---|
| .. | ||
| discourse-presence-test.js | ||