mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 06:03:08 +02:00
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) {
|
||||||
text.value = draft.data.text;
|
if (typeof draft.data.text === 'string' && draft.data.text.trim()) {
|
||||||
|
text.value = draft.data.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof draft.data.cw === 'string' && draft.data.cw.trim()) {
|
||||||
|
cw.value = draft.data.cw;
|
||||||
|
}
|
||||||
|
|
||||||
useCw.value = draft.data.useCw;
|
useCw.value = draft.data.useCw;
|
||||||
cw.value = draft.data.cw;
|
|
||||||
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