fix(frontend): MkPollの集計完了後の挙動がおかしいのを修正 (#16646)

* MkPollの集計完了後の挙動がおかしいのを修正

* fix lint

* watchを削除できるように修正

* fix

* Update Changelog

* fix lint

---------

Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
果物リン 2025-10-20 16:11:01 +09:00 committed by GitHub
parent f0889f4b3c
commit 9aea7363ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View File

@ -16,6 +16,7 @@
- ウォーターマークを回転させると歪む問題を修正
- ウォーターマークを敷き詰めると上下左右反転した画像/文字が表示される問題を修正
- ウォーターマークを回転させた際に画面からはみ出た部分を考慮できるように
- Fix: 投票が終了した後に投票結果が正しく表示されない問題を修正
### Server
-

View File

@ -57,15 +57,8 @@ const remaining = computed(() => {
return Math.floor(Math.max(expiresAtTime.value - now.value, 0) / 1000);
});
const remainingWatchStop = watch(remaining, (to) => {
if (to <= 0) {
showResult.value = true;
remainingWatchStop();
}
}, { immediate: true });
const total = computed(() => sum(props.choices.map(x => x.votes)));
const closed = computed(() => remaining.value === 0);
const closed = computed(() => remaining.value <= 0);
const isVoted = computed(() => !props.multiple && props.choices.some(c => c.isVoted));
const timer = computed(() => i18n.tsx._poll[
remaining.value >= 86400 ? 'remainingDays' :
@ -78,7 +71,16 @@ const timer = computed(() => i18n.tsx._poll[
d: Math.floor(remaining.value / 86400),
}));
const showResult = ref(props.readOnly || isVoted.value);
const showResult = ref(props.readOnly || isVoted.value || closed.value);
if (!closed.value) {
const closedWatchStop = watch(closed, (isNowClosed) => {
if (isNowClosed) {
showResult.value = true;
closedWatchStop();
}
});
}
const pleaseLoginContext = computed<OpenOnRemoteOptions>(() => ({
type: 'lookup',