푸시 터치 액션 수정

This commit is contained in:
Yu Sung 2023-09-13 11:45:41 +09:00
parent 1f992a11dc
commit 58868f613a
2 changed files with 32 additions and 18 deletions

View File

@ -199,19 +199,7 @@ struct HomeView: View {
} }
} }
.onAppear { .onAppear {
if appState.pushRoomId > 0 { if appState.pushMessageId > 0 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
liveViewModel.enterLiveRoom(roomId: appState.pushRoomId)
}
} else if appState.pushChannelId > 0 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
appState.setAppStep(step: .creatorDetail(userId: appState.pushChannelId))
}
} else if appState.pushAudioContentId > 0 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
appState.setAppStep(step: .contentDetail(contentId: appState.pushAudioContentId))
}
} else if appState.pushMessageId > 0 {
viewModel.currentTab = .message viewModel.currentTab = .message
} }
} }

View File

@ -13,6 +13,8 @@ struct SplashView: View {
@State private var isShowForcedUpdatePopup = false @State private var isShowForcedUpdatePopup = false
@State private var isShowUpdatePopup = false @State private var isShowUpdatePopup = false
@StateObject var liveViewModel = LiveViewModel()
var body: some View { var body: some View {
ZStack(alignment: .top) { ZStack(alignment: .top) {
LinearGradient( LinearGradient(
@ -54,9 +56,17 @@ struct SplashView: View {
checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue) checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue)
} }
} else { } else {
withAnimation { DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { withAnimation {
AppState.shared.setAppStep(step: .main) if AppState.shared.pushRoomId > 0 {
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
} else if AppState.shared.pushChannelId > 0 {
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
} else if AppState.shared.pushAudioContentId > 0 {
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
} else {
AppState.shared.setAppStep(step: .main)
}
} }
} }
} }
@ -85,14 +95,30 @@ struct SplashView: View {
} else { } else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
withAnimation { withAnimation {
AppState.shared.setAppStep(step: .main) if AppState.shared.pushRoomId > 0 {
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
} else if AppState.shared.pushChannelId > 0 {
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
} else if AppState.shared.pushAudioContentId > 0 {
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
} else {
AppState.shared.setAppStep(step: .main)
}
} }
} }
} }
} else { } else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
withAnimation { withAnimation {
AppState.shared.setAppStep(step: .main) if AppState.shared.pushRoomId > 0 {
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
} else if AppState.shared.pushChannelId > 0 {
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
} else if AppState.shared.pushAudioContentId > 0 {
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
} else {
AppState.shared.setAppStep(step: .main)
}
} }
} }
} }