From 5b3b211c9a2586bfcf8623c348dd808b5d144964 Mon Sep 17 00:00:00 2001 From: ZyphrZero <133507172+ZyphrZero@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:45:43 +0800 Subject: [PATCH] fix(ui): sync tray menu order after drag-and-drop sorting (#179) The drag-and-drop sorting feature introduced in PR #126 (9eb991d) was updating the provider sort order in the backend and frontend, but failed to update the tray menu to reflect the new order. Changes: - Add updateTrayMenu() call after successful sort order update - Ensures tray menu items are immediately reordered to match the UI This fixes the issue where dragging providers in the main window would not update their order in the system tray menu. Fixes: 9eb991d (feat(ui): add drag-and-drop sorting for provider list) --- src/hooks/useDragSort.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks/useDragSort.ts b/src/hooks/useDragSort.ts index 094b151..d2e0a5b 100644 --- a/src/hooks/useDragSort.ts +++ b/src/hooks/useDragSort.ts @@ -74,6 +74,8 @@ export function useDragSort(providers: Record, appId: AppId) { await queryClient.invalidateQueries({ queryKey: ["providers", appId], }); + // 更新托盘菜单以反映新的排序 + await providersApi.updateTrayMenu(); toast.success( t("provider.sortUpdated", { defaultValue: "排序已更新",