Skip to content

Commit 26efa55

Browse files
committed
Refactor: 홈 화면 로직 개선 및 리팩토링
- 루틴 완료 로직 ToggleStrategy을 통해 main/sub 분리 - 초기화 메소드 initialize로 통합
1 parent 0d93d5f commit 26efa55

5 files changed

Lines changed: 151 additions & 224 deletions

File tree

domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/FetchTodayEmotionUseCase.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ package com.threegap.bitnagil.domain.emotion.usecase
22

33
import com.threegap.bitnagil.domain.emotion.model.TodayEmotion
44
import com.threegap.bitnagil.domain.emotion.repository.EmotionRepository
5+
import java.time.LocalDate
56
import javax.inject.Inject
67

78
class FetchTodayEmotionUseCase @Inject constructor(
89
private val emotionRepository: EmotionRepository,
910
) {
10-
suspend operator fun invoke(currentDate: String): Result<TodayEmotion?> =
11-
emotionRepository.fetchTodayEmotion(currentDate)
11+
suspend operator fun invoke(): Result<TodayEmotion?> {
12+
val currentDate = LocalDate.now().toString()
13+
return emotionRepository.fetchTodayEmotion(currentDate)
14+
}
1215
}

presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fun HomeScreenContainer(
6464
onHelpClick = viewModel::navigateToGuide,
6565
onRegisterRoutineClick = viewModel::navigateToRegisterRoutine,
6666
onRegisterEmotionClick = viewModel::navigateToEmotion,
67-
onShowMoreRoutinesClick = viewModel::navigateToRoutineList
67+
onShowMoreRoutinesClick = viewModel::navigateToRoutineList,
6868
)
6969
}
7070

0 commit comments

Comments
 (0)