Fixes relay type loading from the default list when they are not present in the user's account yet.
This commit is contained in:
@@ -2955,7 +2955,10 @@ class Account(
|
|||||||
// Takes a User's relay list and adds the types of feeds they are active for.
|
// Takes a User's relay list and adds the types of feeds they are active for.
|
||||||
fun activeRelays(): Array<Relay>? {
|
fun activeRelays(): Array<Relay>? {
|
||||||
var usersRelayList = userProfile().latestContactList?.relays()?.map {
|
var usersRelayList = userProfile().latestContactList?.relays()?.map {
|
||||||
val localFeedTypes = localRelays.firstOrNull() { localRelay -> localRelay.url == it.key }?.feedTypes ?: FeedType.values().toSet()
|
val localFeedTypes = localRelays.firstOrNull() { localRelay -> localRelay.url == it.key }?.feedTypes
|
||||||
|
?: Constants.defaultRelays.filter { defaultRelay -> defaultRelay.url == it.key }.firstOrNull()?.feedTypes
|
||||||
|
?: FeedType.values().toSet()
|
||||||
|
|
||||||
Relay(it.key, it.value.read, it.value.write, localFeedTypes, proxy)
|
Relay(it.key, it.value.read, it.value.write, localFeedTypes, proxy)
|
||||||
} ?: return null
|
} ?: return null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user