Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] 서버 싱크 맞추기 #44

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class RecommendFragment : BindingFragment<FragmentRecommendBinding>({ FragmentRe
collectRecommendProductState()
}

override fun onResume() {
super.onResume()
recommendViewModel.getRecommendProduct()
}

private fun addListeners() {
with(binding) {
ivRecommendForYouBack.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class ReleaseFragment : BindingFragment<FragmentReleaseBinding>({ FragmentReleas
}.launchIn(viewLifecycleOwner.lifecycleScope)
}

override fun onResume() {
super.onResume()
viewModel.getReleaseProduct()
}

private fun navigateToProductDetail(productId: Int) {
findNavController().navigate(R.id.action_home_to_product_detail, bundleOf(RecommendFragment.PRODUCT_ID to productId))
}
Expand Down Expand Up @@ -149,8 +154,7 @@ fun ShoesItem(
deleteScrapProduct: (Int) -> Unit,
navigateToProductDetail: (Int) -> Unit,
) {
var isIconChanged by remember { mutableStateOf(false) }

var isIconChanged by remember { mutableStateOf(releaseProductResponseDto.isScrap) }
val iconResource =
if (isIconChanged) {
R.drawable.ic_saved_1_on_24
Expand Down Expand Up @@ -213,7 +217,6 @@ fun ShoesItem(
} else {
postScrapProduct(index + 1)
}

isIconChanged = !isIconChanged
},
)
Expand Down
Loading