From c8dcbc4f867fc3f4384c4fedf4c4ac1913aa3756 Mon Sep 17 00:00:00 2001 From: rustmailer Date: Thu, 28 Aug 2025 04:05:39 +0800 Subject: [PATCH] fix(ui): disable automatic retry for account state and oauth2 tokens --- .../features/accounts/components/oauth2-tokens.tsx | 3 +++ .../accounts/components/running-state-dialog.tsx | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web/src/features/accounts/components/oauth2-tokens.tsx b/web/src/features/accounts/components/oauth2-tokens.tsx index bb7fd37..4059394 100644 --- a/web/src/features/accounts/components/oauth2-tokens.tsx +++ b/web/src/features/accounts/components/oauth2-tokens.tsx @@ -40,6 +40,9 @@ export function OAuth2TokensDialog({ currentRow, open, onOpenChange }: Props) { const { data: oauth2Tokens, isLoading } = useQuery({ queryKey: ['oauth2-tokens', currentRow.id], queryFn: () => get_oauth2_tokens(currentRow.id), + retry: 0, + refetchOnWindowFocus: false, + refetchOnMount: false, }) diff --git a/web/src/features/accounts/components/running-state-dialog.tsx b/web/src/features/accounts/components/running-state-dialog.tsx index 2d3ee06..a4743a2 100644 --- a/web/src/features/accounts/components/running-state-dialog.tsx +++ b/web/src/features/accounts/components/running-state-dialog.tsx @@ -32,7 +32,9 @@ export function RunningStateDialog({ currentRow, open, onOpenChange }: Props) { const { data: state, isLoading } = useQuery({ queryKey: ['running-state', currentRow.id], queryFn: () => account_state(currentRow.id), - refetchInterval: 5000, // 每5秒自动刷新数据 + retry: 0, + refetchOnWindowFocus: false, + refetchInterval: 5000, }) // Helper function to calculate duration @@ -302,6 +304,13 @@ export function RunningStateDialog({ currentRow, open, onOpenChange }: Props) { )} + {!isLoading && !state && ( +
+

No active state available

+

Account synchronization may not have started yet

+
+ )} +