File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1717 */
1818 export let sensor;
1919
20- function exportData () {
21- sensor .set (sensor .value );
20+ function setExportMode () {
2221 // switch to export mode
2322 currentMode .set (modeByID .export );
2423 }
2524
2625 function buildExportURL () {
2726 let exportURL = ' ' ;
28- if (sensor .key .split (' -' ).length >= 2 ) {
27+ if (sensor && sensor .key .split (' -' ).length >= 2 ) {
2928 // account for dashes in the sensor
3029 let [first, ... rest] = sensor .key .split (' -' );
3130 rest = rest .join (' -' );
3534 exportURL += ` &geo_type=${ region .level } &geo_value=${ region .propertyId } ` ;
3635 }
3736 if (date) {
38- console .log (date);
3937 exportURL += ` &start_day=${ formatDateISO (date .value )} &end_day=${ formatDateISO (date .value )} ` ;
4038 }
4139 return exportURL;
6058 </li >
6159 {/each }
6260 <li >
63- <a href ={` ../${modeByID .export .id }/?${buildExportURL ()} ` } on:click |preventDefault ={exportData }
64- >Export Data</a
65- >
61+ <a href ={` ../export/?${buildExportURL ()} ` } on:click ={setExportMode }>Export Data</a >
6662 </li >
6763 </ul >
6864 {/if }
You can’t perform that action at this time.
0 commit comments