FIX: Open drafts for PMs from Activity > Drafts screen.

Draft.get sometimes returns only the sequence number.
This commit is contained in:
Dan Ungureanu 2019-09-16 16:20:02 +03:00
parent 39f7e98b60
commit 520d54d85f
No known key found for this signature in database
GPG Key ID: 0AA2A00D6ACC8B84
1 changed files with 9 additions and 6 deletions

View File

@ -70,13 +70,16 @@ export default Ember.Component.extend(LoadMore, {
} else {
Draft.get(item.draft_key)
.then(d => {
if (d.draft) {
composer.open({
draft: d.draft,
draftKey: item.draft_key,
draftSequence: d.draft_sequence
});
const draft = d.draft || item.data;
if (!draft) {
return;
}
composer.open({
draft,
draftKey: item.draft_key,
draftSequence: d.draft_sequence
});
})
.catch(error => {
popupAjaxError(error);