diff --git a/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/AmountFragment.kt b/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/AmountFragment.kt index 19dbb918..370a6960 100644 --- a/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/AmountFragment.kt +++ b/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/AmountFragment.kt @@ -49,7 +49,9 @@ class AmountFragment : BindingFragment(R.layout.fragment_ private fun initUploadButtonClickListener() { binding.btnAmountNext.setOnSingleClickListener { - uploadViewModel.postWineyFeed(uploadViewModel.content, uploadViewModel.amount.removeComma()) + uploadViewModel.apply { + postWineyFeed(content, amount.removeComma()) + } } } @@ -67,6 +69,7 @@ class AmountFragment : BindingFragment(R.layout.fragment_ is UiState.Failure -> { wineySnackbar(binding.root, false, stringOf(R.string.snackbar_upload_fail)) + uploadViewModel.initPostWineyFeedState() } is UiState.Empty -> { diff --git a/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/UploadViewModel.kt b/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/UploadViewModel.kt index 094a76fa..f380e984 100644 --- a/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/UploadViewModel.kt +++ b/app/src/main/java/org/go/sopt/winey/presentation/main/feed/upload/UploadViewModel.kt @@ -130,6 +130,10 @@ class UploadViewModel @Inject constructor( } } + fun initPostWineyFeedState() { + _postWineyFeedState.value = UiState.Empty + } + private fun createRequestBody( content: String, amount: String