fix: corrected channel name change behavior

This commit is contained in:
andrekir 2023-04-13 17:34:28 -03:00
parent e050ebd2a9
commit dc596e25a2
2 changed files with 10 additions and 14 deletions

View file

@ -40,11 +40,9 @@ data class ChannelSet(
* Return the primary channel info
*/
val primaryChannel: Channel?
get() =
if (protobuf.settingsCount > 0)
Channel(protobuf.getSettings(0), protobuf.loraConfig)
else
null
get() = with(protobuf) {
Channel(getSettings(0), loraConfig).takeIf { settingsCount > 0 }
}
/// Return an URL that represents the current channel values
/// @param upperCasePrefix - portions of the URL can be upper case to make for more efficient QR codes