fix(widgets): prevent NoIntegrationDataError during initial load and scope indicator
- Add isFetched guard in media-requests/list to avoid throwing before data loads - Scope refresh indicator to only track widget and integration queries
This commit is contained in:
1 file changed
+2
-1
@@ -19,7 +19,7 @@ export default function MediaServerWidget({
|
||||
options,
|
||||
width,
|
||||
}: WidgetComponentProps<"mediaRequests-requestList">) {
|
||||
const { data: mediaRequests = [] } = clientApi.widget.mediaRequests.getLatestRequests.useQuery(
|
||||
const { data: mediaRequests = [], isFetched } = clientApi.widget.mediaRequests.getLatestRequests.useQuery(
|
||||
{
|
||||
integrationIds,
|
||||
},
|
||||
@@ -58,6 +58,7 @@ export default function MediaServerWidget({
|
||||
},
|
||||
);
|
||||
|
||||
if (!isFetched) return null;
|
||||
if (mediaRequests.length === 0) throw new NoIntegrationDataError();
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user