Browse Source

properly handle switching to a reading type that doesn't have any readings at all

pull/65/head
Starbeamrainbowlabs 10 months ago
parent
commit
f78c52d8f1
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
  1. 1
      Changelog.md
  2. 9
      client_src/js/LayerDeviceMarkers.mjs

1
Changelog.md

@ -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

9
client_src/js/LayerDeviceMarkers.mjs

@ -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…
Cancel
Save