refactor(widgets): migrate all widgets from useSuspenseQuery to useQuery
Non-blocking data fetching for all 38 widget components. Widgets now render immediately and show data when available, with loading state delegated to the global refresh indicator in the board header.
This commit is contained in:
38 files changed
+96
-67
No files matched your search
@@ -81,7 +81,7 @@ export default function ReleasesWidget({ options }: WidgetComponentProps<"releas
|
||||
);
|
||||
}, [groupedRepositories]);
|
||||
|
||||
const [results] = clientApi.useSuspenseQueries((t) =>
|
||||
const queryResults = clientApi.useQueries((t) =>
|
||||
batchedRepositories.flatMap(({ integrationId, repositories }) =>
|
||||
t.widget.releases.getLatest({
|
||||
integrationId,
|
||||
@@ -94,6 +94,8 @@ export default function ReleasesWidget({ options }: WidgetComponentProps<"releas
|
||||
),
|
||||
);
|
||||
|
||||
const results = queryResults.map((q) => q.data).filter(Boolean);
|
||||
|
||||
const repositories = useMemo(() => {
|
||||
const formattedResults = options.repositories
|
||||
.map((repository) => {
|
||||
|
||||
Reference in new issue
Block a user