Skip to content

Commit

Permalink
Check if shop is null before refreshing shop inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Hafizzle committed Sep 25, 2023
1 parent e1fcc7e commit f34514e
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ open class ShopFragment : BaseMainFragment<FragmentRefreshRecyclerviewBinding>()

override fun onResume() {
super.onResume()
loadShopInventory()
if (shop == null) {
loadShopInventory()
}
}

private fun loadShopInventory() {
Expand Down Expand Up @@ -325,11 +327,13 @@ open class ShopFragment : BaseMainFragment<FragmentRefreshRecyclerviewBinding>()
}
Shop.TIME_TRAVELERS_SHOP -> {
formatTimeTravelersShop(shop1)
activity?.let { activity ->
val subscriptionBottomSheet = EventOutcomeSubscriptionBottomSheetFragment().apply {
eventType = EventOutcomeSubscriptionBottomSheetFragment.EVENT_HOURGLASS_SHOP_OPENED
if (userViewModel.user.value?.isSubscribed == false) {
activity?.let { activity ->
val subscriptionBottomSheet = EventOutcomeSubscriptionBottomSheetFragment().apply {
eventType = EventOutcomeSubscriptionBottomSheetFragment.EVENT_HOURGLASS_SHOP_OPENED
}
subscriptionBottomSheet.show(activity.supportFragmentManager, SubscriptionBottomSheetFragment.TAG)
}
subscriptionBottomSheet.show(activity.supportFragmentManager, SubscriptionBottomSheetFragment.TAG)
}
}
Shop.SEASONAL_SHOP -> {
Expand Down

0 comments on commit f34514e

Please sign in to comment.