-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/mz 181 ledger filter #85
Conversation
# Conflicts: # core/ui/src/main/res/values/strings.xml # feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt # feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt # feature/received/src/main/java/com/susu/feature/received/navigation/ReceivedNavigation.kt # feature/received/src/main/java/com/susu/feature/received/received/ReceivedScreen.kt # feature/received/src/main/res/values/strings.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아이고 확인이 늦어서 죄송합니다
enum class LedgerAlign( | ||
@StringRes val stringResId: Int, | ||
val query: String, | ||
) { | ||
RECENT( | ||
stringResId = R.string.word_align_recently, | ||
query = "createdAt,desc", | ||
), | ||
OUTDATED( | ||
stringResId = R.string.word_align_outdated, | ||
query = "createdAt,asc", | ||
), | ||
HIGH_AMOUNT( | ||
stringResId = R.string.word_align_high_amount, | ||
query = "totalReceivedAmounts,desc", | ||
), | ||
LOW_AMOUNT( | ||
stringResId = R.string.word_align_low_amount, | ||
query = "totalReceivedAmounts,asc", | ||
), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 받아요도 같은 정렬 기준을 사용하던데 ui 모듈로 옮기는건 어떤가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query값이 조금 달라서 분리했어요!
받아요에서는 totalReceivedAmounts
이구 보내요에서는 totalSentAmounts
이에요!
val uiState = viewModel.uiState.collectAsStateWithLifecycle().value | ||
viewModel.sideEffect.collectWithLifecycle { sideEffect -> | ||
when (sideEffect) { | ||
is LedgerFilterSideEffect.HandleException -> TODO() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 처리는 추후에 하시는 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헛 ... 아녀 지금 하겠습니다
} | ||
|
||
fun getLedgerList(needClear: Boolean = false) = viewModelScope.launch { | ||
mutex.withLock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 작업에 mutex가 필요한 이유가 무엇인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnBottomReached
이랑 Filter
과정 등 에서 getLedgerList
함수가 거의 동시에 실행되면서 race condition
이 발생하더라구요 ㅜㅜ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아아 왜지 싶었는데 OnBottomReached
때에 호출되어서 그랬군요 그렇다면 좀 더 늦게 호출된 getLedgerList
는 버려지나요? 혹은 먼저 실행된 getLedgerList
를 기다렸다가 실행되는건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기다렸다가 실행되어요!
💡 Issue
🌱 Key changes
✅ To Reviewers
📸 스크린샷
KakaoTalk_Video_2024-01-22-15-18-01.mp4