From ccf115ca4cdd55c11222b898b14679c920aca4d6 Mon Sep 17 00:00:00 2001 From: Alex <49969959+alexzhang1030@users.noreply.github.com> Date: Sun, 30 Apr 2023 23:19:14 +0800 Subject: [PATCH] fix: refresh status after edit (#2032) --- components/status/StatusActionsMore.vue | 7 ++++++- components/status/StatusDetails.vue | 6 +++++- pages/[[server]]/@[account]/[status].vue | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/components/status/StatusActionsMore.vue b/components/status/StatusActionsMore.vue index e900c20a..aafc77c3 100644 --- a/components/status/StatusActionsMore.vue +++ b/components/status/StatusActionsMore.vue @@ -7,6 +7,10 @@ const props = defineProps<{ command?: boolean }>() +const emit = defineEmits<{ + (event: 'afterEdit'): void +}>() + const { details, command } = $(props) const { @@ -101,10 +105,11 @@ function reply() { } async function editStatus() { - openPublishDialog(`edit-${status.id}`, { + await openPublishDialog(`edit-${status.id}`, { ...await getDraftFromStatus(status), editingStatus: status, }, true) + emit('afterEdit') } function showFavoritedAndBoostedBy() { diff --git a/components/status/StatusDetails.vue b/components/status/StatusDetails.vue index 6a822674..1b64aa24 100644 --- a/components/status/StatusDetails.vue +++ b/components/status/StatusDetails.vue @@ -10,6 +10,10 @@ const props = withDefaults(defineProps<{ actions: true, }) +defineEmits<{ + (event: 'refetchStatus'): void +}>() + const status = $computed(() => { if (props.status.reblog && props.status.reblog) return props.status.reblog @@ -27,7 +31,7 @@ useHydratedHead({