콘텐츠 상세페이지 이동 방식 수정
- NavigationView 적용 - 뒤로가기 시 리스트를 다시 로딩하여 스크롤이 최상단으로 이동하지 않도록 수정
This commit is contained in:
@@ -12,6 +12,8 @@ import RefreshableScrollView
|
||||
struct ContentDetailView: View {
|
||||
|
||||
let contentId: Int
|
||||
|
||||
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
|
||||
@StateObject private var viewModel = ContentDetailViewModel()
|
||||
|
||||
@State private var isShowOrderView = false
|
||||
@@ -24,7 +26,11 @@ struct ContentDetailView: View {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Button {
|
||||
AppState.shared.back()
|
||||
if presentationMode.wrappedValue.isPresented {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
} else {
|
||||
AppState.shared.back()
|
||||
}
|
||||
} label: {
|
||||
Image("ic_back")
|
||||
.resizable()
|
||||
@@ -151,6 +157,8 @@ struct ContentDetailView: View {
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.navigationTitle("")
|
||||
.navigationBarBackButtonHidden()
|
||||
.onAppear {
|
||||
viewModel.contentId = contentId
|
||||
AppState.shared.pushAudioContentId = 0
|
||||
|
Reference in New Issue
Block a user