mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-23 14:13:21 +01:00
Fix the compose status states not inheriting properly
This commit is contained in:
parent
58208a417c
commit
79df9546bd
1 changed files with 25 additions and 25 deletions
|
@ -189,31 +189,6 @@ function Compose({
|
||||||
setVisibility(visibility);
|
setVisibility(visibility);
|
||||||
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
|
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
|
||||||
setSensitive(sensitive);
|
setSensitive(sensitive);
|
||||||
}
|
|
||||||
if (draftStatus) {
|
|
||||||
const {
|
|
||||||
status,
|
|
||||||
spoilerText,
|
|
||||||
visibility,
|
|
||||||
language,
|
|
||||||
sensitive,
|
|
||||||
poll,
|
|
||||||
mediaAttachments,
|
|
||||||
} = draftStatus;
|
|
||||||
const composablePoll = !!poll?.options && {
|
|
||||||
...poll,
|
|
||||||
options: poll.options.map((o) => o?.title || o),
|
|
||||||
expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),
|
|
||||||
};
|
|
||||||
textareaRef.current.value = status;
|
|
||||||
oninputTextarea();
|
|
||||||
focusTextarea();
|
|
||||||
spoilerTextRef.current.value = spoilerText;
|
|
||||||
setVisibility(visibility);
|
|
||||||
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
|
|
||||||
setSensitive(sensitive);
|
|
||||||
setPoll(composablePoll);
|
|
||||||
setMediaAttachments(mediaAttachments);
|
|
||||||
} else if (editStatus) {
|
} else if (editStatus) {
|
||||||
const { visibility, language, sensitive, poll, mediaAttachments } =
|
const { visibility, language, sensitive, poll, mediaAttachments } =
|
||||||
editStatus;
|
editStatus;
|
||||||
|
@ -260,6 +235,31 @@ function Compose({
|
||||||
setSensitive(prefs.postingDefaultSensitive);
|
setSensitive(prefs.postingDefaultSensitive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (draftStatus) {
|
||||||
|
const {
|
||||||
|
status,
|
||||||
|
spoilerText,
|
||||||
|
visibility,
|
||||||
|
language,
|
||||||
|
sensitive,
|
||||||
|
poll,
|
||||||
|
mediaAttachments,
|
||||||
|
} = draftStatus;
|
||||||
|
const composablePoll = !!poll?.options && {
|
||||||
|
...poll,
|
||||||
|
options: poll.options.map((o) => o?.title || o),
|
||||||
|
expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),
|
||||||
|
};
|
||||||
|
textareaRef.current.value = status;
|
||||||
|
oninputTextarea();
|
||||||
|
focusTextarea();
|
||||||
|
spoilerTextRef.current.value = spoilerText;
|
||||||
|
setVisibility(visibility);
|
||||||
|
setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);
|
||||||
|
setSensitive(sensitive);
|
||||||
|
setPoll(composablePoll);
|
||||||
|
setMediaAttachments(mediaAttachments);
|
||||||
|
}
|
||||||
}, [draftStatus, editStatus, replyToStatus]);
|
}, [draftStatus, editStatus, replyToStatus]);
|
||||||
|
|
||||||
const formRef = useRef();
|
const formRef = useRef();
|
||||||
|
|
Loading…
Add table
Reference in a new issue