summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLhc_fl <lhcfl@outlook.com>2024-10-21 01:38:03 +0800
committerLhc_fl <lhcfl@outlook.com>2024-10-21 01:38:03 +0800
commit684be7d7094f44e22ca15d49963f33afdff6dfe2 (patch)
tree0fb8dfdc257981a9d4e64a858e255fe79005bd7f
parentfix: fix type error of useNoteCapture (diff)
downloadsharkey-684be7d7094f44e22ca15d49963f33afdff6dfe2.tar.gz
sharkey-684be7d7094f44e22ca15d49963f33afdff6dfe2.tar.bz2
sharkey-684be7d7094f44e22ca15d49963f33afdff6dfe2.zip
fix: fix type error of useNoteCapture
-rw-r--r--packages/frontend/src/scripts/use-note-capture.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts
index 53eb6cf994..3e2c046da2 100644
--- a/packages/frontend/src/scripts/use-note-capture.ts
+++ b/packages/frontend/src/scripts/use-note-capture.ts
@@ -22,7 +22,7 @@ export function useNoteCapture(props: {
const pureNote = props.pureNote !== undefined ? props.pureNote : props.note;
const connection = $i ? useStream() : null;
- async function onStreamNoteUpdated(noteData): void {
+ async function onStreamNoteUpdated(noteData): Promise<void> {
const { type, id, body } = noteData;
if ((id !== note.value.id) && (id !== pureNote.value.id)) return;
@@ -81,7 +81,7 @@ export function useNoteCapture(props: {
case 'pollVoted': {
const choice = body.choice;
- const choices = [...note.value.poll.choices];
+ const choices = [...note.value.poll!.choices];
choices[choice] = {
...choices[choice],
votes: choices[choice].votes + 1,
@@ -90,7 +90,7 @@ export function useNoteCapture(props: {
} : {}),
};
- note.value.poll.choices = choices;
+ note.value.poll!.choices = choices;
break;
}