Skip to content

Commit 15537e5

Browse files
committed
feat: update retweet count on retweet with a quote
1 parent 5d4319f commit 15537e5

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

app/components/tweet/TweetActionButtons.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ const handleShare = async () => {
177177
</Button>
178178

179179
<!-- Place dialog outside dropdown structure -->
180-
<QuoteTweetDialog v-model:open="showQuoteDialog" :quote-to-tweet="props.tweet" />
180+
<QuoteTweetDialog
181+
v-model:open="showQuoteDialog"
182+
:quote-to-tweet="props.tweet"
183+
@quote-success="emit('retweet-success')"
184+
/>
181185
</div>
182186
</template>

app/components/tweet/composer/QuoteTweetDialog.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ const props = defineProps<{
1010
1111
const emit = defineEmits<{
1212
'update:open': [value: boolean];
13+
'quote-success': [];
1314
}>();
1415
16+
const onQuoteSuccess = () => {
17+
emit('quote-success');
18+
emit('update:open', false);
19+
};
20+
1521
const localOpen = computed({
1622
get: () => props.open ?? false,
1723
set: (value: boolean) => emit('update:open', value),
@@ -21,11 +27,7 @@ const localOpen = computed({
2127
<template>
2228
<UiDialog v-model:open="localOpen">
2329
<UiDialogContent class="h-auto max-w-lg" content-height="h-auto max-h-[95vh]">
24-
<TweetComposer
25-
:quote-to-tweet-id="quoteToTweet.id"
26-
type="quote"
27-
@posted="emit('update:open', false)"
28-
>
30+
<TweetComposer :quote-to-tweet-id="quoteToTweet.id" type="quote" @posted="onQuoteSuccess">
2931
<template #reposted-tweet>
3032
<div class="border-foreground/15 rounded-lg border-1">
3133
<TweetDefaultCard

0 commit comments

Comments
 (0)