mirror of
https://github.com/rustmailer/rustmailer.git
synced 2026-09-05 16:01:21 +00:00
fix(ui): disable automatic retry for account state and oauth2 tokens
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user