fix: don't load text of empty draft
this fixes a small ux quirk where blanking a reply and cancelling it results in an empty reply next time you try to reply to that note, accidentally un-tagging everyone
This commit is contained in:
parent
5bc036180f
commit
2f5c51c1ca
1 changed files with 9 additions and 2 deletions
|
@ -923,12 +923,19 @@ onMounted(() => {
|
||||||
if (!props.instant && !props.mention && !props.specified && !props.mock) {
|
if (!props.instant && !props.mention && !props.specified && !props.mock) {
|
||||||
const draft = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}')[draftKey.value];
|
const draft = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}')[draftKey.value];
|
||||||
if (draft) {
|
if (draft) {
|
||||||
|
if (typeof draft.data.text === 'string' && draft.data.text.trim()) {
|
||||||
text.value = draft.data.text;
|
text.value = draft.data.text;
|
||||||
useCw.value = draft.data.useCw;
|
}
|
||||||
|
|
||||||
|
if (typeof draft.data.cw === 'string' && draft.data.cw.trim()) {
|
||||||
cw.value = draft.data.cw;
|
cw.value = draft.data.cw;
|
||||||
|
}
|
||||||
|
|
||||||
|
useCw.value = draft.data.useCw;
|
||||||
visibility.value = draft.data.visibility;
|
visibility.value = draft.data.visibility;
|
||||||
localOnly.value = draft.data.localOnly;
|
localOnly.value = draft.data.localOnly;
|
||||||
files.value = (draft.data.files || []).filter(draftFile => draftFile);
|
files.value = (draft.data.files || []).filter(draftFile => draftFile);
|
||||||
|
|
||||||
if (draft.data.poll) {
|
if (draft.data.poll) {
|
||||||
poll.value = draft.data.poll;
|
poll.value = draft.data.poll;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue