From 85e163a0ad35558167664cc79819f20d09b8e290 Mon Sep 17 00:00:00 2001 From: Alex <49969959+alexzhang1030@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:56:51 +0800 Subject: [PATCH] feat: support showing publish failed messages (#1209) --- components/publish/PublishErrMessage.vue | 23 +++++++++ components/publish/PublishWidget.vue | 59 ++++++++++++++++++------ composables/masto/publish.ts | 10 +++- locales/en-US.json | 3 ++ locales/zh-CN.json | 6 ++- styles/vars.css | 4 ++ unocss.config.ts | 5 ++ 7 files changed, 93 insertions(+), 17 deletions(-) create mode 100644 components/publish/PublishErrMessage.vue diff --git a/components/publish/PublishErrMessage.vue b/components/publish/PublishErrMessage.vue new file mode 100644 index 00000000..e9ec814d --- /dev/null +++ b/components/publish/PublishErrMessage.vue @@ -0,0 +1,23 @@ + + + diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index b29d1568..6be8c5b9 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -34,7 +34,7 @@ const { dropZoneRef, } = $(useUploadMediaAttachment($$(draft))) -let { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft } = $(usePublish( +let { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft, failedMessages } = $(usePublish( { draftState, ...$$({ expanded, isUploading, initialDraft: initial }), @@ -160,6 +160,29 @@ defineExpose({ > + + +
+ + + + + +
    +
  1. + {{ i + 1 }}. + {{ error }} +
  2. +
+ +
{{ $t('state.uploading') }}
-
@@ -191,10 +208,8 @@ defineExpose({
@@ -209,7 +224,7 @@ defineExpose({ {{ error[0] }} -
+
- + + + + +