refactor(navigation): 전역 경로 기반 단일 내비게이션 흐름으로 전환한다
This commit is contained in:
@@ -10,11 +10,12 @@ import SwiftUI
|
||||
struct ContentNewAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentNewAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
let isFree: Bool
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
DetailNavigationBar(title: isFree ? "최신 무료 콘텐츠" : "최신 콘텐츠")
|
||||
@@ -82,9 +83,12 @@ struct ContentNewAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.isFree = isFree
|
||||
viewModel.getThemeList()
|
||||
viewModel.getNewContentList()
|
||||
if !isInitialized || viewModel.isFree != isFree {
|
||||
viewModel.isFree = isFree
|
||||
viewModel.getThemeList()
|
||||
viewModel.getNewContentList()
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
Reference in New Issue
Block a user