Skip to content

Commit

Permalink
Merge pull request #1591 from novasamatech/fix/network-management-not…
Browse files Browse the repository at this point in the history
…ifications-crash

Update GovernancePushSettingsInteractor.kt
  • Loading branch information
antonijzelinskij authored Jul 16, 2024
2 parents 357a637 + 9011086 commit 017359e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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.enabledChainsFlow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

Expand All @@ -27,9 +28,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 017359e

Please sign in to comment.