Skip to content

Commit

Permalink
Fix : 이미 선택한 사진이 3장일 때 사진 첨부하기를 누를 시 안내 메시지 출력
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Dec 1, 2023
1 parent 3726e2d commit 90afd7c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import com.teamwiney.ui.theme.Pretendard
import com.teamwiney.ui.theme.WineyTheme
import kotlinx.coroutines.flow.collectLatest

@OptIn(ExperimentalGlideComposeApi::class)
@Composable
fun NoteWineInfoMemoScreen(
appState: WineyAppState = rememberWineyAppState(),
Expand Down Expand Up @@ -111,7 +112,7 @@ fun NoteWineInfoMemoScreen(
if (areGranted) {
imagePicker.launch(3 - uiState.wineNote.imgs.size)
} else {
appState.showSnackbar("미디어 권한과 카메라 권한을 허용해야 갤러리를 사용할 수 있습니다.")
appState.showSnackbar("미디어 권한과 카메라 권한을 허용해야 갤러리를 사용할 수 있습니다")

// 허용하지 않았을 경우 설정창으로 이동
Handler(Looper.getMainLooper()).postDelayed({
Expand Down Expand Up @@ -219,12 +220,14 @@ fun NoteWineInfoMemoScreen(

Button(
onClick = {
if (uiState.wineNote.imgs.isNotEmpty()) {
if (uiState.wineNote.imgs.size < 3) {
if (!allPermissionsGranted) {
launchMultiplePermissions.launch(permissions)
} else {
imagePicker.launch(3 - uiState.wineNote.imgs.size)
}
} else {
appState.showSnackbar("사진은 최대 3장까지 첨부 가능합니다")
}
},
modifier = Modifier
Expand Down

0 comments on commit 90afd7c

Please sign in to comment.