update counts immediately

This commit is contained in:
fly_mc 2024-11-10 01:58:08 +08:00
parent afec66841d
commit ec500ccdae
2 changed files with 20 additions and 8 deletions

View file

@ -916,7 +916,16 @@ async function post(ev?: MouseEvent) {
}
nextTick(() => {
deleteDraft();
if (props.reply) {
props.reply.repliesCount = (props.reply.repliesCount || 0) + 1;
}
if (props.quote) {
props.renote.renoteCount = (props.renote.renoteCount || 0) + 1;
}
emit('posted');
if (postAccount.value != null ? postAccount.value.id : null) {
postAccount.value = null;
}
if (postData.text && postData.text !== '') {
const hashtags_ = mfm.parse(postData.text).map(x => x.type === 'hashtag' && x.props.hashtag).filter(x => x) as string[];
const history = JSON.parse(miLocalStorage.getItem('hashtags') ?? '[]') as string[];

View file

@ -576,6 +576,7 @@ export function getRenoteMenu(props: {
channelId: appearNote.channelId,
}).then(() => {
os.toast(i18n.ts.renoted);
appearNote.renoteCount = (appearNote.renoteCount || 0) + 1;
});
}
},
@ -624,6 +625,7 @@ export function getRenoteMenu(props: {
renoteId: appearNote.id,
}).then(() => {
os.toast(i18n.ts.renoted);
appearNote.renoteCount = (appearNote.renoteCount || 0) + 1;
});
}
},
@ -665,6 +667,7 @@ export function getRenoteMenu(props: {
channelId: channel.id,
}).then(() => {
os.toast(i18n.tsx.renotedToX({ name: channel.name }));
appearNote.renoteCount = (appearNote.renoteCount || 0) + 1;
});
}
},