fix: scope polling to widgets, fix retry, guard dates, throttle umami
- Remove global refetchInterval; scope to widget queries via setQueryDefaults - Fix error boundary retry: correct queryKey to [["widget"]], move invalidation to onReset - Add toValidDate() helper in @homarr/common for cache hydration safety - Guard date formatting in media-releases and media-requests against non-Date values - Set umami refetchInterval to 60s via shared umamiQueryOptions constant - Simplify dns-hole mutations to invalidate() instead of manual optimistic setData
This commit is contained in:
11 files changed
+84
-114
No files matched your search
@@ -17,6 +17,11 @@ export function formatDuration(milliseconds: number) {
|
||||
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
export const toValidDate = (value: unknown): Date | null => {
|
||||
const date = value instanceof Date ? value : new Date(value as string | number);
|
||||
return Number.isFinite(date.getTime()) ? date : null;
|
||||
};
|
||||
|
||||
export const isDateWithin = (date: Date, relativeDate: string): boolean => {
|
||||
if (relativeDate.length < 2) {
|
||||
throw new Error("Relative date must be at least 2 characters long");
|
||||
|
||||
Reference in new issue
Block a user