We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c788aae commit a899875Copy full SHA for a899875
1 file changed
static/lib/composer/drafts.js
@@ -88,6 +88,12 @@ define('composer/drafts', function () {
88
var raw = postContainer.find('textarea').val();
89
var storage = app.user.uid ? localStorage : sessionStorage;
90
91
+ if (postData.hasOwnProperty('cid') && !postData.save_id.endsWith(':cid:' + postData.cid)) {
92
+ // A new cid was selected, the save_id needs updating
93
+ drafts.removeDraft(postData.save_id); // First, delete the old draft
94
+ postData.save_id = postData.save_id.replace(/cid:\d+$/, 'cid:' + postData.cid); // then create a new save_id
95
+ }
96
+
97
if (raw.length || (title && title.length)) {
98
storage.setItem(postData.save_id, raw);
99
0 commit comments