fix: sync widget modernization with dev

This commit is contained in:
Thomas Camlong committed 2026-08-02 01:37:01 +02:00
commit 79ae42f0c3
55 files changed
+1613 -679

No files matched your search

+9 -2
View File
@@ -122,11 +122,18 @@ const runtimeQueriesStateKey = "__homarrRuntimeQueries";
export const setWidgetRuntimeQueries = (
widgetStateRef: React.MutableRefObject<Record<string, unknown> | null> | undefined,
queries: readonly NormalizedWidgetQuery[],
queryKeys: readonly QueryKey[],
) => {
if (!widgetStateRef) return;
const state = widgetStateRef.current ?? {};
state[runtimeQueriesStateKey] = queries;
state[runtimeQueriesStateKey] = queryKeys.flatMap((queryKey) => {
const path = queryKey[0];
if (!Array.isArray(path) || !path.every((part): part is string => typeof part === "string")) return [];
const queryKeyOptions = queryKey[1];
const input = isRecord(queryKeyOptions) && "input" in queryKeyOptions ? queryKeyOptions.input : undefined;
return [{ path, input }];
});
widgetStateRef.current = state;
};