File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
presentation/src/main/java/com/whyranoid/presentation/community Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ internal class CommunityItemFragment :
62
62
63
63
private fun handleEvent (event : Event ) {
64
64
when (event) {
65
- is Event .CategoryItemClick -> {
65
+ is Event .GroupItemClick -> {
66
66
val action =
67
67
CommunityFragmentDirections .actionCommunityFragmentToGroupDetailFragment(event.groupInfo)
68
68
findNavController().navigate(action)
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class CommunityViewModel @Inject constructor(
40
40
get() = _eventFlow .asSharedFlow()
41
41
42
42
fun onCategoryItemClicked (groupInfo : GroupInfoUiModel ) {
43
- emitEvent(Event .CategoryItemClick (groupInfo))
43
+ emitEvent(Event .GroupItemClick (groupInfo))
44
44
}
45
45
46
46
private fun emitEvent (event : Event ) {
@@ -59,7 +59,9 @@ class CommunityViewModel @Inject constructor(
59
59
}
60
60
61
61
getPostsUseCase().onEach { postList ->
62
- _postList .value = postList
62
+ _postList .value = postList.sortedByDescending { post ->
63
+ post.updatedAt
64
+ }
63
65
}.launchIn(viewModelScope)
64
66
}
65
67
}
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ package com.whyranoid.presentation.community
3
3
import com.whyranoid.presentation.model.GroupInfoUiModel
4
4
5
5
sealed class Event {
6
- data class CategoryItemClick (val groupInfo : GroupInfoUiModel ) : Event()
6
+ data class GroupItemClick (val groupInfo : GroupInfoUiModel ) : Event()
7
+ // data class CategoryItemClick(val groupInfo: GroupInfoUiModel) : Event()
7
8
}
You can’t perform that action at this time.
0 commit comments