diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index 01fc6845..035e3901 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -569,6 +569,14 @@ class GetFrontInfo extends \sammo\BaseAPI //TODO: 마지막 투표, 토너먼트, 베팅을 했는지 정보를 별도로 가져와야 함. aux? + $auxInfo = []; + + if ($globalInfo['lastVote']) { + $myLastVoteID = $db->queryFirstField('SELECT vote_id FROM vote WHERE general_id = %i ORDER BY vote_id DESC LIMIT 1', $generalID); + if($myLastVoteID) { + $auxInfo['myLastVote'] = $myLastVoteID; + } + } return [ 'result' => true, @@ -577,6 +585,7 @@ class GetFrontInfo extends \sammo\BaseAPI 'nation' => $nationInfo, 'general' => $generalInfo, 'city' => $cityInfo, + 'aux' => $auxInfo, ]; } } diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 82019b2b..5a73dbdc 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -459,7 +459,7 @@ watch(refreshCounter, async () => { } const lastVoteID = response.global.lastVoteID; - if (lastVoteID > lastVoteState.value) { + if (lastVoteID > lastVoteState.value && lastVoteID > (response.aux.myLastVote ?? 0)) { lastVoteState.value = lastVoteID; toasts.warning( { diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 6883bb6b..54741808 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -221,6 +221,9 @@ export type GetFrontInfoResponse = { } | null >; }; + aux: { + myLastVote?: number; + }; };