fix(widgets): fix downloads widget and add SSR prefetch
Remove WidgetEmptyState guard from downloads (widget renders fine with empty data). Fix columnsSort filter logic from .some() to .every() so non-sortable columns are correctly excluded. Add server-side prefetch via tRPC caller so download data is available immediately on page load.
This commit is contained in:
1 parent
f49ae79c99
commit
682f6bd3ea
4 files changed
+32
-2
No files matched your search
@@ -9,6 +9,7 @@ import { createSettings } from "@homarr/settings/creator";
|
||||
import { reduceWidgetOptionsWithDefaultValues } from ".";
|
||||
import prefetchForApps from "./app/prefetch";
|
||||
import prefetchForBookmarks from "./bookmarks/prefetch";
|
||||
import prefetchForDownloads from "./downloads/prefetch";
|
||||
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
|
||||
import type { inferOptionsFromCreator } from "./options";
|
||||
|
||||
@@ -19,6 +20,7 @@ const prefetchCallbacks: Partial<{
|
||||
}> = {
|
||||
bookmarks: prefetchForBookmarks,
|
||||
app: prefetchForApps,
|
||||
downloads: prefetchForDownloads,
|
||||
};
|
||||
|
||||
export const prefetchForKindAsync = async <TKind extends WidgetKind>(
|
||||
|
||||
Reference in new issue
Block a user