diff --git a/Changelog.md b/Changelog.md index 1b9d89c..f123a83 100644 --- a/Changelog.md +++ b/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 diff --git a/client_src/js/LayerDeviceMarkers.mjs b/client_src/js/LayerDeviceMarkers.mjs index edc7560..7b17ffc 100644 --- a/client_src/js/LayerDeviceMarkers.mjs +++ b/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 // --------------------------------------------------------------------