refactor: convert ChannelSet to protobuf extensions

This commit is contained in:
andrekir 2023-10-07 08:22:12 -03:00 committed by Andre K
parent 3288b07e5e
commit 4e7ea67da0
9 changed files with 103 additions and 116 deletions

View file

@ -313,10 +313,10 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
}
model.channels.asLiveData().observe(viewLifecycleOwner) {
if (!model.isConnected()) it.protobuf.let { ch ->
if (!model.isConnected()) {
val maxChannels = model.maxChannels
if (!ch.hasLoraConfig() && ch.settingsCount > 0)
scanModel.setErrorText("Channels (${ch.settingsCount} / $maxChannels)")
if (!it.hasLoraConfig() && it.settingsCount > 0)
scanModel.setErrorText("Channels (${it.settingsCount} / $maxChannels)")
}
}