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 17
17
*/
18
18
export let sensor;
19
19
20
- function exportData () {
21
- sensor .set (sensor .value );
20
+ function setExportMode () {
22
21
// switch to export mode
23
22
currentMode .set (modeByID .export );
24
23
}
25
24
26
25
function buildExportURL () {
27
26
let exportURL = ' ' ;
28
- if (sensor .key .split (' -' ).length >= 2 ) {
27
+ if (sensor && sensor .key .split (' -' ).length >= 2 ) {
29
28
// account for dashes in the sensor
30
29
let [first, ... rest] = sensor .key .split (' -' );
31
30
rest = rest .join (' -' );
35
34
exportURL += ` &geo_type=${ region .level } &geo_value=${ region .propertyId } ` ;
36
35
}
37
36
if (date) {
38
- console .log (date);
39
37
exportURL += ` &start_day=${ formatDateISO (date .value )} &end_day=${ formatDateISO (date .value )} ` ;
40
38
}
41
39
return exportURL;
60
58
</li >
61
59
{/each }
62
60
<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 >
66
62
</li >
67
63
</ul >
68
64
{/if }
You can’t perform that action at this time.
0 commit comments