Skip to content

Commit

Permalink
Update GovernancePushSettingsInteractor.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
antonijzelinskij committed Jul 16, 2024
1 parent 4f082a3 commit 1af0234
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import io.novafoundation.nova.runtime.ext.defaultComparatorFrom
import io.novafoundation.nova.runtime.ext.openGovIfSupported
import io.novafoundation.nova.runtime.multiNetwork.ChainRegistry
import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain
import io.novafoundation.nova.runtime.multiNetwork.enabledChains
import io.novafoundation.nova.runtime.multiNetwork.enabledChainsFlow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

Expand All @@ -27,9 +29,9 @@ class RealGovernancePushSettingsInteractor(
) : GovernancePushSettingsInteractor {

override fun governanceChainsFlow(): Flow<List<ChainWithGovTracks>> {
return chainRegistry.currentChains
.map {
it.filter { it.pushSupport }
return chainRegistry.enabledChainsFlow()
.map { chains ->
chains.filter { it.pushSupport }
.flatMap { it.supportedGovTypes() }
.map { (chain, govType) -> ChainWithGovTracks(chain, govType, getTrackIds(chain, govType)) }
.sortedWith(Chain.defaultComparatorFrom(ChainWithGovTracks::chain))
Expand Down

0 comments on commit 1af0234

Please sign in to comment.