Fix random crash in SubscriptionFragment

pull/9207/head^2
Stypox 2022-10-27 18:45:06 +02:00
rodzic a41aa01461
commit 4b32890b5f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -422,6 +422,12 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
feedGroupsSortMenuItem.showSortButton = groups.size > 1
feedGroupsSortMenuItem.listViewMode = listViewMode
binding.itemsList.post {
if (context == null) {
// since this part was posted to the next UI cycle, the fragment might have been
// removed in the meantime
return@post
}
feedGroupsCarousel.notifyChanged(FeedGroupCarouselItem.PAYLOAD_UPDATE_LIST_VIEW_MODE)
feedGroupsSortMenuItem.notifyChanged(GroupsHeader.PAYLOAD_UPDATE_ICONS)