File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
vector/src/main/java/im/vector/app/features/roomprofile/polls Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -30,4 +30,7 @@ data class RoomPollsViewState(
3030) : MavericksState {
3131
3232 constructor (roomProfileArgs: RoomProfileArgs ) : this (roomId = roomProfileArgs.roomId)
33+
34+ fun hasNoPolls () = polls.isEmpty()
35+ fun hasNoPollsAndCanLoadMore () = ! isSyncing && hasNoPolls() && canLoadMore
3336}
Original file line number Diff line number Diff line change @@ -119,11 +119,10 @@ abstract class RoomPollsListFragment :
119119 canLoadMore = viewState.canLoadMore,
120120 nbLoadedDays = viewState.nbLoadedDays,
121121 )
122- views.roomPollsEmptyTitle.isVisible = viewState.polls.isEmpty() && ! viewState.isSyncing
123- views.roomPollsLoadMoreWhenEmpty.isVisible = viewState.polls.isEmpty() && viewState.canLoadMore && ! viewState.isSyncing
124- views.roomPollsLoadMoreWhenEmptyProgress.isVisible = viewState.polls.isEmpty() && viewState.canLoadMore &&
125- viewState.isLoadingMore && ! viewState.isSyncing
126- views.roomPollsLoadMoreWhenEmptyProgress.isEnabled = ! viewState.isLoadingMore
122+ views.roomPollsEmptyTitle.isVisible = ! viewState.isSyncing && viewState.hasNoPolls()
123+ views.roomPollsLoadMoreWhenEmpty.isVisible = viewState.hasNoPollsAndCanLoadMore()
124+ views.roomPollsLoadMoreWhenEmpty.isEnabled = ! viewState.isLoadingMore
125+ views.roomPollsLoadMoreWhenEmptyProgress.isVisible = viewState.hasNoPollsAndCanLoadMore() && viewState.isLoadingMore
127126 }
128127
129128 override fun onPollClicked (pollId : String ) {
You can’t perform that action at this time.
0 commit comments