From 2f5c51c1ca5e9726a590211416796a772beb9511 Mon Sep 17 00:00:00 2001 From: ShittyKopper Date: Mon, 27 Nov 2023 22:12:20 +0300 Subject: [PATCH 01/49] 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 --- packages/frontend/src/components/MkPostForm.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index c9784fc40f..a209128d55 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -923,12 +923,19 @@ onMounted(() => { if (!props.instant && !props.mention && !props.specified && !props.mock) { const draft = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}')[draftKey.value]; 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; - cw.value = draft.data.cw; visibility.value = draft.data.visibility; localOnly.value = draft.data.localOnly; files.value = (draft.data.files || []).filter(draftFile => draftFile); + if (draft.data.poll) { poll.value = draft.data.poll; } From 62a5793e7104b1806a7b7ebe270632af1a4cd9c0 Mon Sep 17 00:00:00 2001 From: ShittyKopper Date: Mon, 27 Nov 2023 23:55:43 +0300 Subject: [PATCH 02/49] fix: don't show filename as alt text --- packages/frontend/src/components/MkMediaBanner.vue | 2 +- packages/frontend/src/components/MkMediaImage.vue | 8 ++++---- packages/frontend/src/components/MkMediaList.vue | 4 ++-- packages/frontend/src/components/MkMediaVideo.vue | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/MkMediaBanner.vue b/packages/frontend/src/components/MkMediaBanner.vue index 4594c8a1db..7b0387cefe 100644 --- a/packages/frontend/src/components/MkMediaBanner.vue +++ b/packages/frontend/src/components/MkMediaBanner.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only