feat: add channel editor (#627)

This commit is contained in:
Andre K 2023-04-29 07:14:30 -03:00 committed by GitHub
parent c821eb3681
commit e5a860cb36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 561 additions and 104 deletions

View file

@ -42,7 +42,11 @@ class ChannelSetRepository @Inject constructor(
suspend fun addSettings(channel: ChannelProtos.Channel) {
channelSetStore.updateData { preference ->
preference.toBuilder().addSettings(channel.settings).build()
if (preference.settingsCount > channel.index) {
preference.toBuilder().setSettings(channel.index, channel.settings).build()
} else {
preference.toBuilder().addSettings(channel.settings).build()
}
}
}