fix useWidgetAPI refreshInterval

pull/791/head
Michael Shamoon 2 years ago
parent 642f21e56b
commit fc2e17fa59

@ -4,8 +4,8 @@ import { formatProxyUrl } from "./api-helpers";
export default function useWidgetAPI(widget, ...options) { export default function useWidgetAPI(widget, ...options) {
const config = {}; const config = {};
if (options?.refreshInterval) { if (options && options[1]?.refreshInterval) {
config.refreshInterval = options.refreshInterval; config.refreshInterval = options[1].refreshInterval;
} }
const { data, error } = useSWR(formatProxyUrl(widget, ...options), config); const { data, error } = useSWR(formatProxyUrl(widget, ...options), config);
// make the data error the top-level error // make the data error the top-level error

Loading…
Cancel
Save