add connection feedback

This commit is contained in:
andrekir 2022-08-23 21:51:27 -03:00
parent 69f311e133
commit d5c32407ad

View file

@ -281,7 +281,17 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
}
model.localConfig.observe(viewLifecycleOwner) {
updateNodeInfo()
if (!model.isConnected()) {
val configCount = it.allFields.size
binding.scanStatusText.text = "Device config ($configCount / 7)"
} else updateNodeInfo()
}
model.channels.observe(viewLifecycleOwner) {
if (!model.isConnected()) {
val channelCount = it?.protobuf?.settingsCount ?: 0
binding.scanStatusText.text = "Channels ($channelCount / 8)"
}
}
// Also watch myNodeInfo because it might change later