Fixes the BookmarkScreen update after adding and removing a bookmark to the list
This commit is contained in:
@@ -454,11 +454,21 @@ class Account(
|
||||
|
||||
val liveHiddenUsers = flowHiddenUsers.asLiveData()
|
||||
|
||||
val decryptBookmarks: LiveData<BookmarkListEvent> by lazy {
|
||||
val decryptBookmarks: LiveData<BookmarkListEvent?> by lazy {
|
||||
userProfile().live().innerBookmarks.switchMap { userState ->
|
||||
liveData(Dispatchers.IO) {
|
||||
userState.user.latestBookmarkList?.privateTags(signer) {
|
||||
scope.launch(Dispatchers.IO) { userState.user.latestBookmarkList?.let { emit(it) } }
|
||||
if (userState.user.latestBookmarkList == null) {
|
||||
emit(null)
|
||||
} else {
|
||||
emit(
|
||||
withTimeoutOrNull(1000) {
|
||||
suspendCancellableCoroutine { continuation ->
|
||||
userState.user.latestBookmarkList?.privateTags(signer) {
|
||||
continuation.resume(userState.user.latestBookmarkList)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ fun BookmarkListScreen(
|
||||
privateFeedViewModel.invalidateData()
|
||||
}
|
||||
|
||||
|
||||
RenderBookmarkScreen(privateFeedViewModel, accountViewModel, nav, publicFeedViewModel)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user