mirror of
https://git.youjo.love/youjo/youjo-fe.git
synced 2024-11-20 05:49:54 +01:00
Fix edits and redrafts being erased by drafts
This commit is contained in:
parent
2129f32c3a
commit
73b1884d88
1 changed files with 21 additions and 19 deletions
|
@ -165,31 +165,33 @@ const PostStatusForm = {
|
|||
}
|
||||
}
|
||||
|
||||
let draftKey = 'status';
|
||||
if (!this.statusId) {
|
||||
let draftKey = 'status';
|
||||
if (this.replyTo) {
|
||||
draftKey = 'reply:' + this.replyTo;
|
||||
} 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) {
|
||||
this.togglePollForm();
|
||||
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) {
|
||||
this.togglePollForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue