From 3e648f6fbc660dde760c3c375683163ac92730cd Mon Sep 17 00:00:00 2001 From: Peter Budai Date: Sat, 11 Feb 2023 18:04:41 +0100 Subject: [PATCH] feat(editor): Respect default privacy setting of the account (#1699) --- components/publish/PublishWidget.vue | 4 +++- composables/masto/statusDrafts.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index cc4e653b..9feea9fe 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -27,7 +27,7 @@ const emit = defineEmits<{ const { t } = useI18n() const draftState = useDraft(draftKey, initial) -const { draft } = $(draftState) +const { draft, isEmpty } = $(draftState) const { isExceedingAttachmentLimit, isUploading, failedAttachments, isOverDropZone, @@ -48,6 +48,8 @@ const { editor } = useTiptap({ set: (newVal) => { draft.params.status = newVal draft.lastUpdated = Date.now() + if (isEmpty) + clearEmptyDrafts() }, }), placeholder: computed(() => placeholder ?? draft.params.inReplyToId ? t('placeholder.replying') : t('placeholder.default_1')), diff --git a/composables/masto/statusDrafts.ts b/composables/masto/statusDrafts.ts index 58596f32..ec3c0391 100644 --- a/composables/masto/statusDrafts.ts +++ b/composables/masto/statusDrafts.ts @@ -30,7 +30,7 @@ export function getDefaultDraft(options: Partial