refactor(navigation): 전역 경로 기반 단일 내비게이션 흐름으로 전환한다
This commit is contained in:
@@ -9,11 +9,12 @@ import SwiftUI
|
||||
|
||||
struct ContentAllByThemeView: View {
|
||||
@StateObject var viewModel = ContentAllByThemeViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
let themeId: Int
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
DetailNavigationBar(title: viewModel.theme)
|
||||
@@ -111,8 +112,11 @@ struct ContentAllByThemeView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.themeId = themeId
|
||||
viewModel.getContentList()
|
||||
if !isInitialized || viewModel.themeId != themeId {
|
||||
viewModel.themeId = themeId
|
||||
viewModel.getContentList()
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user