Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/page/Detail/DetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default function Detail() {
} catch {
// polling 실패는 무시
}
}, 10000);
}, 1000);

return () => clearInterval(interval);
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
8 changes: 4 additions & 4 deletions src/page/Main/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ export default function Main() {
useQuery<FamilyApiResponse>({
queryKey: ["familyMembers"],
queryFn: () => familyService.getMembers().then((res) => res.data),
refetchInterval: 10000,
refetchInterval: 1000,
refetchIntervalInBackground: true,
placeholderData: keepPreviousData, // ← v5 방식
});

const { data: usageData } = useQuery<UsageData>({
queryKey: ["UsageData"],
queryFn: () => sharedPoolService.getUsageData().then((res) => res.data),
refetchInterval: 10000, // 10초마다 자동 폴링
refetchInterval: 1000, // 10초마다 자동 폴링
refetchIntervalInBackground: true, // 백그라운드에서도 폴링
placeholderData: keepPreviousData,
});
Expand Down Expand Up @@ -95,7 +95,7 @@ export default function Main() {
useQuery<SharedData>({
queryKey: ["sharedPool"],
queryFn: () => sharedPoolService.getMainRemainingAmount(),
refetchInterval: 10000, // 10초마다 자동 폴링
refetchInterval: 1000, // 10초마다 자동 폴링
refetchIntervalInBackground: true, // 백그라운드에서도 폴링
placeholderData: keepPreviousData,
});
Expand All @@ -107,7 +107,7 @@ export default function Main() {
queryKey: ["blockStatus", lineId],
queryFn: () => blockService.getBlockStatus(lineId!).then((res) => res.data),
enabled: !!lineId,
refetchInterval: 10000, // 10초마다 자동 폴링
refetchInterval: 1000, // 10초마다 자동 폴링
refetchIntervalInBackground: true, // 백그라운드에서도 폴링
placeholderData: keepPreviousData,
});
Expand Down
Loading