diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index 6f0c0323cc..7f8937b0c2 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -94,7 +94,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
diff --git a/packages/frontend/src/components/MkPoll.vue b/packages/frontend/src/components/MkPoll.vue
index 4cac1fe9c3..943735b9c2 100644
--- a/packages/frontend/src/components/MkPoll.vue
+++ b/packages/frontend/src/components/MkPoll.vue
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- -
+
-
@@ -35,18 +35,18 @@ import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { useInterval } from '@/scripts/use-interval.js';
-import { WithNonNullable } from '@/type.js';
const props = defineProps<{
- note: WithNonNullable;
+ noteId: string;
+ poll: NonNullable;
readOnly?: boolean;
}>();
const remaining = ref(-1);
-const total = computed(() => sum(props.note.poll.choices.map(x => x.votes)));
+const total = computed(() => sum(props.poll.choices.map(x => x.votes)));
const closed = computed(() => remaining.value === 0);
-const isVoted = computed(() => !props.note.poll.multiple && props.note.poll.choices.some(c => c.isVoted));
+const isVoted = computed(() => !props.poll.multiple && props.poll.choices.some(c => c.isVoted));
const timer = computed(() => i18n.t(
remaining.value >= 86400 ? '_poll.remainingDays' :
remaining.value >= 3600 ? '_poll.remainingHours' :
@@ -60,9 +60,9 @@ const timer = computed(() => i18n.t(
const showResult = ref(props.readOnly || isVoted.value);
// 期限付きアンケート
-if (props.note.poll.expiresAt) {
+if (props.poll.expiresAt) {
const tick = () => {
- remaining.value = Math.floor(Math.max(new Date(props.note.poll.expiresAt).getTime() - Date.now(), 0) / 1000);
+ remaining.value = Math.floor(Math.max(new Date(props.poll.expiresAt!).getTime() - Date.now(), 0) / 1000);
if (remaining.value === 0) {
showResult.value = true;
}
@@ -81,15 +81,15 @@ const vote = async (id) => {
const { canceled } = await os.confirm({
type: 'question',
- text: i18n.t('voteConfirm', { choice: props.note.poll.choices[id].text }),
+ text: i18n.t('voteConfirm', { choice: props.poll.choices[id].text }),
});
if (canceled) return;
await misskeyApi('notes/polls/vote', {
- noteId: props.note.id,
+ noteId: props.noteId,
choice: id,
});
- if (!showResult.value) showResult.value = !props.note.poll.multiple;
+ if (!showResult.value) showResult.value = !props.poll.multiple;
};
diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue
index 438140649e..aea297467e 100644
--- a/packages/frontend/src/components/MkSubNoteContent.vue
+++ b/packages/frontend/src/components/MkSubNoteContent.vue
@@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.poll }}
-
+
-
+