@@ -8,17 +8,17 @@ import com.threegap.bitnagil.domain.writeroutine.model.RepeatDay
88import com.threegap.bitnagil.domain.writeroutine.model.RoutineUpdateType
99import com.threegap.bitnagil.domain.writeroutine.usecase.EditRoutineUseCase
1010import com.threegap.bitnagil.domain.writeroutine.usecase.RegisterRoutineUseCase
11- import com.threegap.bitnagil.presentation.common.extension.displayTitle
1211import com.threegap.bitnagil.presentation.writeroutine.contract.WriteRoutineSideEffect
1312import com.threegap.bitnagil.presentation.writeroutine.contract.WriteRoutineState
1413import com.threegap.bitnagil.presentation.writeroutine.model.Date
1514import com.threegap.bitnagil.presentation.writeroutine.model.Day
1615import com.threegap.bitnagil.presentation.writeroutine.model.RepeatType
1716import com.threegap.bitnagil.presentation.writeroutine.model.SelectableDay
18- import com.threegap.bitnagil.presentation.writeroutine.model.SubRoutine
17+ import com.threegap.bitnagil.presentation.writeroutine.model.SubRoutineUiModel
1918import com.threegap.bitnagil.presentation.writeroutine.model.Time
2019import com.threegap.bitnagil.presentation.writeroutine.model.WriteRoutineType
2120import com.threegap.bitnagil.presentation.writeroutine.model.navarg.WriteRoutineScreenArg
21+ import com.threegap.bitnagil.presentation.writeroutine.model.toUiModel
2222import dagger.assisted.Assisted
2323import dagger.assisted.AssistedFactory
2424import dagger.assisted.AssistedInject
@@ -46,7 +46,7 @@ class WriteRoutineViewModel @AssistedInject constructor(
4646 )
4747
4848 private var routineId: String? = null
49- private var oldSubRoutines : List <SubRoutine > = listOf ()
49+ private var oldSubRoutineUiModels : List <SubRoutineUiModel > = listOf ()
5050
5151 init {
5252 val navigationArg = writeRoutineArg
@@ -131,7 +131,7 @@ class WriteRoutineViewModel @AssistedInject constructor(
131131 }
132132 getRecommendRoutineUseCase(recommendRoutineId).fold(
133133 onSuccess = { routine ->
134- oldSubRoutines = routine.subRoutines.map { SubRoutine .fromDomainRecommendSubRoutine(it ) }
134+ oldSubRoutineUiModels = routine.subRoutines.map { it.toUiModel( ) }
135135
136136 reduce {
137137 state.copy(
@@ -142,9 +142,9 @@ class WriteRoutineViewModel @AssistedInject constructor(
142142 startDate = Date .now(),
143143 endDate = Date .now(),
144144 subRoutineNames = listOf (
145- oldSubRoutines .getOrNull(0 )?.name ? : " " ,
146- oldSubRoutines .getOrNull(1 )?.name ? : " " ,
147- oldSubRoutines .getOrNull(2 )?.name ? : " " ,
145+ oldSubRoutineUiModels .getOrNull(0 )?.name ? : " " ,
146+ oldSubRoutineUiModels .getOrNull(1 )?.name ? : " " ,
147+ oldSubRoutineUiModels .getOrNull(2 )?.name ? : " " ,
148148 ),
149149 loading = false ,
150150 recommendedRoutineType = routine.category,
0 commit comments