mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-12-03 08:03:00 +00:00
properly handle switching to a reading type that doesn't have any readings at all
This commit is contained in:
parent
3dc7b58e6e
commit
f78c52d8f1
2 changed files with 9 additions and 1 deletions
|
@ -13,6 +13,7 @@ This is the changelog for the air quality web interface and its associated HTTP
|
|||
## v0.14
|
||||
- Remove the heatmap background overlay :-(
|
||||
- Colour device markers based on the latest reading
|
||||
- Properly handle switching to a reading type that doesn't have any readings at all
|
||||
- [API] Optimise `list-reading-types` action, which necessitated a database schema update and the removal of the `count` property on returned objects
|
||||
- [API] Drastically optimise `device-info` by removing a redundant JOIN
|
||||
|
||||
|
|
|
@ -57,7 +57,14 @@ class LayerDeviceMarkers extends Emitter {
|
|||
|
||||
// 3: Fetch the latest readings data
|
||||
// --------------------------------------------------------------------
|
||||
let device_values = await this.map_manager.readings_data.fetch(reading_type, datetime);
|
||||
let device_values;
|
||||
try {
|
||||
device_values = await this.map_manager.readings_data.fetch(reading_type, datetime);
|
||||
}
|
||||
catch(error) {
|
||||
alert(error);
|
||||
device_values = new Map();
|
||||
}
|
||||
|
||||
// 4: Add a marker for each device
|
||||
// --------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue