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 liveHiddenUsers = flowHiddenUsers.asLiveData()
|
||||||
|
|
||||||
val decryptBookmarks: LiveData<BookmarkListEvent> by lazy {
|
val decryptBookmarks: LiveData<BookmarkListEvent?> by lazy {
|
||||||
userProfile().live().innerBookmarks.switchMap { userState ->
|
userProfile().live().innerBookmarks.switchMap { userState ->
|
||||||
liveData(Dispatchers.IO) {
|
liveData(Dispatchers.IO) {
|
||||||
userState.user.latestBookmarkList?.privateTags(signer) {
|
if (userState.user.latestBookmarkList == null) {
|
||||||
scope.launch(Dispatchers.IO) { userState.user.latestBookmarkList?.let { emit(it) } }
|
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()
|
privateFeedViewModel.invalidateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RenderBookmarkScreen(privateFeedViewModel, accountViewModel, nav, publicFeedViewModel)
|
RenderBookmarkScreen(privateFeedViewModel, accountViewModel, nav, publicFeedViewModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user