Skip to content

Commit

Permalink
feat: Better error handling for Airnotes with no recent data
Browse files Browse the repository at this point in the history
  • Loading branch information
tjvantoll committed May 25, 2022
1 parent b32362b commit a260a96
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/routes/Dashboard/Dashboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
localStorage.setItem('tempDisplay', tempDisplay);
}
const getSafecastDashboardLink = (deviceUID) => (
`http://tt.safecast.org/dashboard/note:${deviceUID}`
);
const downloadData = () => {
const csv = 'data:text/csv;charset=utf-8,' +
unparse(readings);
Expand Down Expand Up @@ -105,10 +109,20 @@
{#if noDataError}
<div class="alert">
<h4 class="alert-heading">{NO_DATA_ERROR_HEADING}</h4>
There is no data associated with this Airnote. If this is a new Airnote,
it may take several hours for your device to report its first readings.
For help setting up your Airnote, visit
<a href='https://start.airnote.live'>start.airnote.live</a>.
<p>
There is no recent data associated with this Airnote. If this is a new
Airnote, it may take several hours for your device to report its first
readings. For help setting up your Airnote, visit
<a href='https://start.airnote.live'>start.airnote.live</a>.
</p>

<p>
If this is a device that has previously reported readings, you can view
historical data on
<a href={getSafecastDashboardLink(deviceUID)}>this device’s Safecast dashboard</a>,
and <a href="https://discuss.blues.io">reach out on our forum</a> if you need
help getting your Airnote back up and running.
</p>
</div>
{/if}

Expand Down Expand Up @@ -279,7 +293,7 @@
</div>

<div class="full-data-link">
<a in:fade href="http://tt.safecast.org/dashboard/note:{deviceUID}" class="svg-link" target="_blank">
<a in:fade href="{getSafecastDashboardLink(deviceUID)}" class="svg-link" target="_blank">
<span>View full data</span>
<ExternalLinkIcon />
</a>
Expand Down

0 comments on commit a260a96

Please sign in to comment.