Avoids triggering an error when decoding invalid hexes.

This commit is contained in:
Vitor Pamplona
2024-03-19 19:29:50 -04:00
parent ffc0a7c6ed
commit bfbfcb6ed2
@@ -237,10 +237,12 @@ class Account(
private val liveHomeList: StateFlow<NoteState?> by lazy { private val liveHomeList: StateFlow<NoteState?> by lazy {
defaultHomeFollowList defaultHomeFollowList
.transformLatest { .transformLatest {
if (it != GLOBAL_FOLLOWS && it != KIND3_FOLLOWS) {
LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let { LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let {
emit(it) emit(it)
} }
} }
}
.flattenMerge() .flattenMerge()
.stateIn(scope, SharingStarted.Eagerly, null) .stateIn(scope, SharingStarted.Eagerly, null)
} }
@@ -272,10 +274,12 @@ class Account(
private val liveNotificationList: StateFlow<NoteState?> by lazy { private val liveNotificationList: StateFlow<NoteState?> by lazy {
defaultNotificationFollowList defaultNotificationFollowList
.transformLatest { .transformLatest {
if (it != GLOBAL_FOLLOWS && it != KIND3_FOLLOWS) {
LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let { LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let {
emit(it) emit(it)
} }
} }
}
.flattenMerge() .flattenMerge()
.stateIn(scope, SharingStarted.Eagerly, null) .stateIn(scope, SharingStarted.Eagerly, null)
} }
@@ -307,10 +311,12 @@ class Account(
private val liveStoriesList: StateFlow<NoteState?> by lazy { private val liveStoriesList: StateFlow<NoteState?> by lazy {
defaultStoriesFollowList defaultStoriesFollowList
.transformLatest { .transformLatest {
if (it != GLOBAL_FOLLOWS && it != KIND3_FOLLOWS) {
LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let { LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let {
emit(it) emit(it)
} }
} }
}
.flattenMerge() .flattenMerge()
.stateIn(scope, SharingStarted.Eagerly, null) .stateIn(scope, SharingStarted.Eagerly, null)
} }
@@ -342,10 +348,12 @@ class Account(
private val liveDiscoveryList: StateFlow<NoteState?> by lazy { private val liveDiscoveryList: StateFlow<NoteState?> by lazy {
defaultDiscoveryFollowList defaultDiscoveryFollowList
.transformLatest { .transformLatest {
if (it != GLOBAL_FOLLOWS && it != KIND3_FOLLOWS) {
LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let { LocalCache.checkGetOrCreateAddressableNote(it)?.flow()?.metadata?.stateFlow?.let {
emit(it) emit(it)
} }
} }
}
.flattenMerge() .flattenMerge()
.stateIn(scope, SharingStarted.Eagerly, null) .stateIn(scope, SharingStarted.Eagerly, null)
} }