푸시 터치 액션 수정

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 {
if appState.pushRoomId > 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 {
if appState.pushMessageId > 0 {
viewModel.currentTab = .message
}
}

View File

@ -13,6 +13,8 @@ struct SplashView: View {
@State private var isShowForcedUpdatePopup = false
@State private var isShowUpdatePopup = false
@StateObject var liveViewModel = LiveViewModel()
var body: some View {
ZStack(alignment: .top) {
LinearGradient(
@ -54,14 +56,22 @@ struct SplashView: View {
checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue)
}
} else {
withAnimation {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
withAnimation {
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)
}
}
}
}
}
}
private func checkAppVersion(latestVersion: String?) {
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
@ -85,19 +95,35 @@ struct SplashView: View {
} else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
withAnimation {
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 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
withAnimation {
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)
}
}
}
}
}
}
struct SplashView_Previews: PreviewProvider {
static var previews: some View {