From 1a7005a8f906787c2e3b4def09a970fc43b96d57 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Wed, 28 Jan 2026 10:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AE=BE=E5=A4=87=E7=BD=AE=E9=A1=B6=E4=B8=94=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=BB=84=E8=89=B2=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserMenu.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/UserMenu.tsx b/src/components/UserMenu.tsx index 81a5ee1..765a741 100644 --- a/src/components/UserMenu.tsx +++ b/src/components/UserMenu.tsx @@ -2788,12 +2788,23 @@ export const UserMenu: React.FC = () => { ) : (
- {devices.map((device) => { + {devices + .sort((a, b) => { + // 当前设备置顶 + if (a.isCurrent && !b.isCurrent) return -1; + if (!a.isCurrent && b.isCurrent) return 1; + return 0; + }) + .map((device) => { const DeviceIcon = getDeviceIcon(device.deviceInfo); return (