fix(main): 추천 홈 후속 검증을 보완한다
This commit is contained in:
@@ -24,8 +24,10 @@ struct MainView: View {
|
||||
@State private var isShowPlayer = false
|
||||
@State private var isShowAuthView = false
|
||||
@State private var isShowAuthConfirmView = false
|
||||
@State private var isShowRecommendationFollowAllConfirmDialog = false
|
||||
@State private var isCreatorActionMenuPresented = false
|
||||
@State private var pendingAction: (() -> Void)? = nil
|
||||
@State private var pendingRecommendationFollowAllAction: (() -> Void)? = nil
|
||||
@State private var payload = Payload()
|
||||
@State private var hasLoadedMainData = false
|
||||
|
||||
@@ -75,6 +77,10 @@ struct MainView: View {
|
||||
authConfirmDialog
|
||||
}
|
||||
|
||||
if isShowRecommendationFollowAllConfirmDialog {
|
||||
recommendationFollowAllConfirmDialog
|
||||
}
|
||||
|
||||
if liveViewModel.isShowPaymentDialog {
|
||||
LivePaymentDialog(
|
||||
title: liveViewModel.paymentDialogTitle,
|
||||
@@ -177,7 +183,7 @@ struct MainView: View {
|
||||
onTapLive: handleRecommendationLiveTap,
|
||||
onTapCreator: handleRecommendationCreatorTap,
|
||||
onTapContent: handleRecommendationContentTap,
|
||||
onTapCharacter: handleRecommendationCreatorTap,
|
||||
onTapCharacter: handleRecommendationCharacterTap,
|
||||
onTapCommunityPost: handleRecommendationCommunityPostTap,
|
||||
onTapBanner: handleRecommendationBannerTap,
|
||||
onTapLiveAll: handleRecommendationLiveAllTap,
|
||||
@@ -323,6 +329,34 @@ struct MainView: View {
|
||||
pendingAction = nil
|
||||
}
|
||||
|
||||
private var recommendationFollowAllConfirmDialog: some View {
|
||||
SodaV2ActionModal(
|
||||
title: I18n.HomeRecommendation.followAllConfirmTitle,
|
||||
message: I18n.HomeRecommendation.followAllConfirmDescription,
|
||||
button1: SodaV2ActionModalButton(
|
||||
label: I18n.HomeRecommendation.followAllConfirmAction,
|
||||
action: confirmRecommendationFollowAll
|
||||
),
|
||||
button2: SodaV2ActionModalButton(
|
||||
label: I18n.Common.cancel,
|
||||
action: dismissRecommendationFollowAllConfirmDialog
|
||||
),
|
||||
onDimmedTap: dismissRecommendationFollowAllConfirmDialog
|
||||
)
|
||||
}
|
||||
|
||||
private func confirmRecommendationFollowAll() {
|
||||
let action = pendingRecommendationFollowAllAction
|
||||
isShowRecommendationFollowAllConfirmDialog = false
|
||||
pendingRecommendationFollowAllAction = nil
|
||||
action?()
|
||||
}
|
||||
|
||||
private func dismissRecommendationFollowAllConfirmDialog() {
|
||||
isShowRecommendationFollowAllConfirmDialog = false
|
||||
pendingRecommendationFollowAllAction = nil
|
||||
}
|
||||
|
||||
private var authView: some View {
|
||||
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
|
||||
.onConfirm { _ in true }
|
||||
@@ -502,6 +536,13 @@ struct MainView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func handleRecommendationCharacterTap(characterId: Int) {
|
||||
guard characterId > 0 else { return }
|
||||
performRecommendationDetailAction(requiresAdultContent: true) {
|
||||
appState.setAppStep(step: .characterDetail(characterId: characterId))
|
||||
}
|
||||
}
|
||||
|
||||
private func handleRecommendationCommunityPostTap(postId: Int) {
|
||||
guard postId > 0 else { return }
|
||||
performRecommendationDetailAction {
|
||||
@@ -510,7 +551,14 @@ struct MainView: View {
|
||||
}
|
||||
|
||||
private func handleRecommendationFollowAllTap(action: @escaping () -> Void) {
|
||||
performRecommendationDetailAction(action: action)
|
||||
let trimmed = token.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard !trimmed.isEmpty else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
return
|
||||
}
|
||||
|
||||
pendingRecommendationFollowAllAction = action
|
||||
isShowRecommendationFollowAllConfirmDialog = true
|
||||
}
|
||||
|
||||
private func handleFollowingAllTap() {
|
||||
@@ -681,7 +729,9 @@ struct MainView: View {
|
||||
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
||||
|
||||
if isKoreanCountry && auth == false {
|
||||
pendingAction = action
|
||||
pendingAction = {
|
||||
performRecommendationDetailAction(requiresAdultContent: true, action: action)
|
||||
}
|
||||
isShowAuthConfirmView = true
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user