awslabs / iot-app-kit

A development library for creating web applications to visualize industrial data
Apache License 2.0
113 stars 59 forks source link

fix(alarms): return blank alarm data when queries are loading #2990

Closed jmbuss closed 2 weeks ago

jmbuss commented 2 weeks ago

Overview

Bugfix for useAlarmAssets. If the useDescribeAssets / useDescribeAssetModels queries were loading for the first time, their response will be undefined. In that case, we were not returning any AlarmData objects. This means that we could not correctly access the isLoading flags. The hook will now return an empty AlarmData object with the query status if the useDescribeAssets / useDescribeAssetModels queries responses are undefined.

Legal

This project is available under the Apache 2.0 License.