File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import DataSet, { DataGroup } from '../data/DataSet';
2323import EpiDate from '../data/EpiDate' ;
2424import EpiPoint from '../data/EpiPoint' ;
2525import { get } from 'svelte/store' ;
26- import { expandedDataGroups } from '../store' ;
26+ import { apiKey , expandedDataGroups , storeApiKeys } from '../store' ;
2727
2828// import DataSet from "../data/DataSet";
2929// import EpiDate from "../data/EpiDate";
@@ -260,6 +260,12 @@ export function importCOVIDcast({
260260 api_key : string ;
261261} ) : Promise < DataGroup | null > {
262262 const title = `[API] COVIDcast: ${ data_source } :${ signal } (${ geo_type } :${ geo_value } )` ;
263+ if ( ! api_key && get ( storeApiKeys ) ) {
264+ // if no API key was passed to this method, but we have a saved one, use it...
265+ // this gets around access control and rate limiting when using an epivis "shared"
266+ // link (an URL-encoded signal list, processed through `deriveLinkDefaults`).
267+ api_key = get ( apiKey ) ;
268+ }
263269 return loadDataSet (
264270 title ,
265271 'covidcast' ,
You can’t perform that action at this time.
0 commit comments