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