Making sure an empty relay list uses the default list from Amethyst

This commit is contained in:
Vitor Pamplona
2024-07-19 16:14:14 -04:00
parent 15ab955a7d
commit d1da863d3c
@@ -2761,7 +2761,10 @@ class Account(
// Takes a User's relay list and adds the types of feeds they are active for.
fun activeRelays(): Array<RelaySetupInfo>? {
val usersRelayList =
userProfile().latestContactList?.relays()?.map {
userProfile()
.latestContactList
?.relays()
?.map {
val url = RelayUrlFormatter.normalize(it.key)
val localFeedTypes =
@@ -2773,7 +2776,7 @@ class Account(
?: Constants.activeTypesGlobalChats
RelaySetupInfo(url, it.value.read, it.value.write, localFeedTypes)
} ?: return null
}?.ifEmpty { null } ?: return null
return usersRelayList.toTypedArray()
}