diff --git a/src/utils/proxy/use-widget-api.js b/src/utils/proxy/use-widget-api.js index 05eb220ec..f9235d787 100644 --- a/src/utils/proxy/use-widget-api.js +++ b/src/utils/proxy/use-widget-api.js @@ -4,8 +4,8 @@ import { formatProxyUrl } from "./api-helpers"; export default function useWidgetAPI(widget, ...options) { const config = {}; - if (options?.refreshInterval) { - config.refreshInterval = options.refreshInterval; + if (options && options[1]?.refreshInterval) { + config.refreshInterval = options[1].refreshInterval; } const { data, error } = useSWR(formatProxyUrl(widget, ...options), config); // make the data error the top-level error