forked from AkkomaGang/akkoma-fe
Merge pull request 'Fix edits and redrafts being erased by drafts' (#297) from solidsanek/pleroma-fe:drafts-edit-redraft-fix into develop
Reviewed-on: AkkomaGang/akkoma-fe#297
This commit is contained in:
commit
ddea499a36
1 changed files with 25 additions and 23 deletions
|
@ -169,31 +169,33 @@ const PostStatusForm = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let draftKey = 'status';
|
if (!this.statusId) {
|
||||||
if (this.replyTo) {
|
let draftKey = 'status';
|
||||||
draftKey = 'reply:' + this.replyTo;
|
if (this.replyTo) {
|
||||||
} else if (this.quoteId) {
|
draftKey = 'reply:' + this.replyTo;
|
||||||
draftKey = 'quote:' + this.quoteId;
|
} else if (this.quoteId) {
|
||||||
}
|
draftKey = 'quote:' + this.quoteId;
|
||||||
|
|
||||||
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
|
|
||||||
|
|
||||||
if (draft) {
|
|
||||||
statusParams = {
|
|
||||||
spoilerText: draft.data.spoilerText,
|
|
||||||
status: draft.data.status,
|
|
||||||
sensitiveIfSubject,
|
|
||||||
nsfw: draft.data.nsfw,
|
|
||||||
files: draft.data.files,
|
|
||||||
poll: draft.data.poll,
|
|
||||||
mediaDescriptions: draft.data.mediaDescriptions,
|
|
||||||
visibility: draft.data.visibility,
|
|
||||||
language: draft.data.language,
|
|
||||||
contentType: draft.data.contentType
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (draft.data.poll) {
|
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
|
||||||
this.togglePollForm();
|
|
||||||
|
if (draft) {
|
||||||
|
statusParams = {
|
||||||
|
spoilerText: draft.data.spoilerText,
|
||||||
|
status: draft.data.status,
|
||||||
|
sensitiveIfSubject,
|
||||||
|
nsfw: draft.data.nsfw,
|
||||||
|
files: draft.data.files,
|
||||||
|
poll: draft.data.poll,
|
||||||
|
mediaDescriptions: draft.data.mediaDescriptions,
|
||||||
|
visibility: draft.data.visibility,
|
||||||
|
language: draft.data.language,
|
||||||
|
contentType: draft.data.contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
if (draft.data.poll) {
|
||||||
|
this.togglePollForm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue