fix(ui): disable automatic retry for account state and oauth2 tokens

This commit is contained in:
rustmailer
2025-08-28 04:05:39 +08:00
parent a31ba582b1
commit c8dcbc4f86
2 changed files with 13 additions and 1 deletions
@@ -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,
})
@@ -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) {
</div>
)}
{!isLoading && !state && (
<div className="h-full flex flex-col justify-center items-center py-8">
<p className="text-sm text-muted-foreground">No active state available</p>
<p className="text-xs text-muted-foreground">Account synchronization may not have started yet</p>
</div>
)}
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Close</Button>