summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-03-06 21:08:42 +0900
committerGitHub <noreply@github.com>2024-03-06 21:08:42 +0900
commit7ead98cbe592e6911e4a54550cb7bb507e782d7c (patch)
tree8a8c57c5dda5d6971da212a63e46954ef212a5b0 /packages/frontend/src/scripts
parentRevert "perf: boot.jsの調整" (diff)
downloadsharkey-7ead98cbe592e6911e4a54550cb7bb507e782d7c.tar.gz
sharkey-7ead98cbe592e6911e4a54550cb7bb507e782d7c.tar.bz2
sharkey-7ead98cbe592e6911e4a54550cb7bb507e782d7c.zip
enhance(frontend): リアクションの総数を表示するように (#13532)
* enhance(frontend): リアクションの総数を表示するように * Update Changelog * リアクション選択済の色をaccentに
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/use-note-capture.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts
index 524ac5d3fe..542d8ab52b 100644
--- a/packages/frontend/src/scripts/use-note-capture.ts
+++ b/packages/frontend/src/scripts/use-note-capture.ts
@@ -35,6 +35,7 @@ export function useNoteCapture(props: {
const currentCount = (note.value.reactions || {})[reaction] || 0;
note.value.reactions[reaction] = currentCount + 1;
+ note.value.reactionCount += 1;
if ($i && (body.userId === $i.id)) {
note.value.myReaction = reaction;
@@ -49,6 +50,7 @@ export function useNoteCapture(props: {
const currentCount = (note.value.reactions || {})[reaction] || 0;
note.value.reactions[reaction] = Math.max(0, currentCount - 1);
+ note.value.reactionCount = Math.max(0, note.value.reactionCount - 1);
if (note.value.reactions[reaction] === 0) delete note.value.reactions[reaction];
if ($i && (body.userId === $i.id)) {