fixed some little UI bugs

- We could open the CDashDisplay specific layout before it existed -
Crash!
- We could open the stream UI before there was a provider- Crash!
This commit is contained in:
2026-09-17 23:01:50 +01:00
parent 59fa825da1
commit 15b997c22f
3 changed files with 29 additions and 0 deletions
+8
View File
@@ -71,6 +71,14 @@ func (ds *DeviceService) GetDevice(name string) (devices.Device, error) {
return val, nil
}
func (ds *DeviceService) DeviceExists(name string) bool {
if _, ok := ds.Devices[name]; !ok {
return false
}
return true
}
func (ds *DeviceService) StartStream() {
// NOTE: i'm using this pattern a whole lot. Maybe I can create a struct to handle this
var ctx context.Context
+8
View File
@@ -230,3 +230,11 @@ func (t *TelemetryService) StopStream() {
t.activeProvider.StopStream()
}
func (t *TelemetryService) HasActiveProvider() bool {
if t.activeProvider == nil {
return false
}
return true
}