refactor(navigation): 전역 경로 기반 단일 내비게이션 흐름으로 전환한다

This commit is contained in:
Yu Sung
2026-03-06 16:34:44 +09:00
parent f145de87aa
commit 42ce09d927
34 changed files with 1181 additions and 873 deletions

View File

@@ -10,6 +10,7 @@ import SwiftUI
struct SeriesMainByGenreView: View {
@StateObject var viewModel = SeriesMainByGenreViewModel()
@State private var isInitialized = false
var body: some View {
ZStack {
@@ -41,17 +42,16 @@ struct SeriesMainByGenreView: View {
) {
ForEach(viewModel.seriesList.indices, id: \.self) { index in
let item = viewModel.seriesList[index]
NavigationLink {
SeriesDetailView(seriesId: item.seriesId)
} label: {
SeriesMainItemView(item: item, width: width, height: width * 227 / 160)
.contentShape(Rectangle())
.onAppear {
if index == viewModel.seriesList.count - 1 {
viewModel.getSeriesListByGenre()
}
SeriesMainItemView(item: item, width: width, height: width * 227 / 160)
.contentShape(Rectangle())
.onAppear {
if index == viewModel.seriesList.count - 1 {
viewModel.getSeriesListByGenre()
}
}
}
.onTapGesture {
AppState.shared.setAppStep(step: .seriesDetail(seriesId: item.seriesId))
}
}
}
.padding(.horizontal, horizontalPadding)
@@ -73,7 +73,10 @@ struct SeriesMainByGenreView: View {
}
}
.onAppear {
viewModel.getGenreList()
if !isInitialized {
viewModel.getGenreList()
isInitialized = true
}
}
if viewModel.isLoading {