Skip to content

Commit

Permalink
bug: Screen 에서는 FinishActivity emit 하지 않음 & FinishActivity emit 은 Vie…
Browse files Browse the repository at this point in the history
…wModel 에서만 진행 (#439)
  • Loading branch information
riflockle7 authored Apr 30, 2023
1 parent b2a9c5e commit f7e2245
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package team.duckie.app.android.feature.ui.create.problem.screen

import android.app.Activity
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -32,6 +33,7 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
Expand Down Expand Up @@ -79,6 +81,7 @@ internal fun ExamInformationScreen(
viewModel: CreateProblemViewModel = activityViewModel(),
modifier: Modifier,
) {
val activity = LocalContext.current as Activity
val state = viewModel.collectAsState().value.examInformation
val coroutineScope = rememberCoroutineScope()
val focusManager = LocalFocusManager.current
Expand Down Expand Up @@ -270,7 +273,7 @@ internal fun ExamInformationScreen(
rightButtonText = stringResource(id = R.string.ok),
rightButtonOnClick = {
createProblemExitDialogVisible = false
viewModel.finishCreateProblem()
activity.finish()
},
onDismissRequest = { createProblemExitDialogVisible = false },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ internal class CreateProblemViewModel @Inject constructor(
}

/** 문제 만들기 화면을 종료한다. */
internal fun finishCreateProblem() = intent {
private fun finishCreateProblem() = intent {
postSideEffect(CreateProblemSideEffect.FinishActivity)
}

Expand Down

0 comments on commit f7e2245

Please sign in to comment.