From 994c73adb248ed889c3bd348d5ee206251228298 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 25 Mar 2023 03:07:38 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=84=A4=EB=AC=B8=EC=A1=B0=EC=82=AC=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=EB=8F=84=20DB=EC=A0=95=EB=B3=B4=EB=A5=BC=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=ED=95=98=EC=97=AC=20=ED=95=9C=EB=B2=88?= =?UTF-8?q?=EB=A7=8C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/GetFrontInfo.php | 9 +++++++++ hwe/ts/PageFront.vue | 2 +- hwe/ts/defs/API/Global.ts | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) 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; + }; };