mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 08:20:58 +00:00 
			
		
		
		
	Merge pull request #791 from benphelps/fix-787
Fix: useWidgetAPI refreshInterval not working
This commit is contained in:
		
						commit
						cf38395100
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user