푸시 혹은 공유링크를 타고 앱을 실행했을 때 처리되는 로직 수정

This commit is contained in:
Yu Sung
2023-08-19 22:57:10 +09:00
parent 8e23f65086
commit 5a771f14bd
4 changed files with 41 additions and 3 deletions

View File

@@ -155,6 +155,44 @@ struct LiveView: View {
}
}
}
.valueChanged(value: appState.pushRoomId) { value in
DispatchQueue.main.async {
appState.setAppStep(step: .main)
if value > 0 {
viewModel.enterRoom(roomId: value)
}
}
}
.valueChanged(value: appState.pushChannelId) { value in
DispatchQueue.main.async {
appState.setAppStep(step: .main)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
if value > 0 {
appState.setAppStep(step: .creatorDetail(userId: value))
}
}
}
}
.valueChanged(value: appState.pushAudioContentId) { value in
appState.setAppStep(step: .main)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
if value > 0 {
appState.setAppStep(step: .contentDetail(contentId: value))
}
}
}
.onAppear {
if appState.pushRoomId > 0 {
viewModel.enterRoom(roomId: appState.pushRoomId)
} else if appState.pushChannelId > 0 {
appState.setAppStep(step: .creatorDetail(userId: appState.pushChannelId))
} else if appState.pushAudioContentId > 0 {
appState.setAppStep(step: .contentDetail(contentId: appState.pushAudioContentId))
}
}
}
private func onCreateSuccess(response: CreateLiveRoomResponse) {