Skip to content

Commit

Permalink
Merge pull request #620 from radixdlt/fix/ABW-2555-developer-section-…
Browse files Browse the repository at this point in the history
…added-multiple-times

[ABW-2555] Fix showing duplicate dev section
  • Loading branch information
jakub-rdx authored Nov 1, 2023
2 parents a75f9bf + 6c621a5 commit bf6612f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class AccountSettingsViewModel @Inject constructor(
viewModelScope.launch {
getFreeXrdUseCase.getFaucetState(args.address).collect { faucetState ->
if (shouldShowDeveloperSettings(faucetState)) {
val developerSectionExist = state.value.settingsSections.any {
it is AccountSettingsSection.DevelopmentSection
}
if (developerSectionExist) return@collect
_state.update {
it.copy(
settingsSections = (
Expand All @@ -55,7 +59,7 @@ class AccountSettingsViewModel @Inject constructor(
AccountSettingItem.DevSettings
)
)
).distinct().toPersistentList()
).toPersistentList()
)
}
}
Expand Down

0 comments on commit bf6612f

Please sign in to comment.