Skip to content

Commit

Permalink
resolve lint error [FoKE-Developers#46]
Browse files Browse the repository at this point in the history
- Error: Flow operator functions should not be invoked within composition
   > 이 에러는 Jetpack Compose에서 Flow 연산자를 직접 컴포지션 안에서 호출할 때 발생합니다. 컴포지션이 다시 일어날 때마다 새로운 Flow가 생성되어 문제가 발생하기 때문에, Flow 연산자를 컴포지션 외부로 이동시켜야 합니다.
   > 에러 메시지에서 설명한 대로 Flow 연산자를 컴포지션 밖에서 사용하거나, remember 또는 LaunchedEffect를 사용하여 적절히 처리해야 합니다.
- TODO: 추후 gradle task에서 lint 검사할 수 있도록 하는 방안
  • Loading branch information
DokySp committed Oct 3, 2024
1 parent 36b091e commit a2aa1bb
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ fun SettingScreen(
popBackStack: () -> Unit,
viewModel: SettingViewModel = hiltViewModel()
) {
val cameraSelectedIndex by viewModel.cameraSourceType.map {
CameraSourceType.entries.indexOf(it)
val cameraSelectedIndex by remember {
viewModel.cameraSourceType.map { CameraSourceType.entries.indexOf(it) }
}.collectAsState(CameraSourceTypeError)
val cameraIPAddress by viewModel.cameraIPAddress.collectAsState()
val cameraIPAddress by remember {
viewModel.cameraIPAddress
}.collectAsState()
val cameraTypeList = CameraSourceType.entries.map { it.name }

FourCutTogetherTheme {
Expand Down

0 comments on commit a2aa1bb

Please sign in to comment.