From 2f0cd32c18c54cab9189374128874d941a9536ab Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 31 Jul 2022 19:50:52 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B6=80=EB=8C=80=20=ED=8E=B8=EC=84=B1?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=B6=80=EB=8C=80=EC=9E=A5=20=EC=A7=91?= =?UTF-8?q?=ED=95=A9=20=EC=88=9C=EC=84=9C=EB=A1=9C=20=EC=A0=95=EB=A0=AC=20?= =?UTF-8?q?=ED=95=84=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageTroop.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hwe/ts/PageTroop.vue b/hwe/ts/PageTroop.vue index 8c75205d..a9e462ec 100644 --- a/hwe/ts/PageTroop.vue +++ b/hwe/ts/PageTroop.vue @@ -302,7 +302,17 @@ async function refresh() { troopList.value = new Map(); - for (const { id: troopLeaderID, name: troopName, turntime: troopTurntime, reservedCommand } of troops) { + const sortedTroops= troops.sort((lhs, rhs) => { + if(lhs.turntime < rhs.turntime) { + return -1; + } + if(lhs.turntime > rhs.turntime) { + return 1; + } + return lhs.id - rhs.id; + }); + + for (const { id: troopLeaderID, name: troopName, turntime: troopTurntime, reservedCommand } of sortedTroops) { if (!generalList.value.has(troopLeaderID)) { toasts.warning({ title: "경고",