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(
30
30
) : MavericksState {
31
31
32
32
constructor (roomProfileArgs: RoomProfileArgs ) : this (roomId = roomProfileArgs.roomId)
33
+
34
+ fun hasNoPolls () = polls.isEmpty()
35
+ fun hasNoPollsAndCanLoadMore () = ! isSyncing && hasNoPolls() && canLoadMore
33
36
}
Original file line number Diff line number Diff line change @@ -119,11 +119,10 @@ abstract class RoomPollsListFragment :
119
119
canLoadMore = viewState.canLoadMore,
120
120
nbLoadedDays = viewState.nbLoadedDays,
121
121
)
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
127
126
}
128
127
129
128
override fun onPollClicked (pollId : String ) {
You can’t perform that action at this time.
0 commit comments