refactor(navigation): 전역 경로 기반 단일 내비게이션 흐름으로 전환한다
This commit is contained in:
@@ -10,9 +10,10 @@ import SwiftUI
|
||||
struct ContentMainAlarmAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentMainAlarmAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
DetailNavigationBar(title: "새로운 알람")
|
||||
@@ -81,7 +82,10 @@ struct ContentMainAlarmAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getContentMainAlarmAll()
|
||||
if !isInitialized {
|
||||
viewModel.getContentMainAlarmAll()
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
@@ -10,9 +10,10 @@ import SwiftUI
|
||||
struct ContentMainAsmrAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentNewAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
DetailNavigationBar(title: "새로운 ASMR")
|
||||
@@ -72,7 +73,14 @@ struct ContentMainAsmrAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.selectedTheme = "ASMR"
|
||||
if !isInitialized {
|
||||
if viewModel.selectedTheme != "ASMR" {
|
||||
viewModel.selectedTheme = "ASMR"
|
||||
} else if viewModel.newContentList.isEmpty {
|
||||
viewModel.getNewContentList()
|
||||
}
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
@@ -46,7 +46,7 @@ struct ContentMainViewV2: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
ZStack {
|
||||
Color.black.ignoresSafeArea()
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@ import SwiftUI
|
||||
struct ContentMainIntroduceCreatorAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentMainIntroduceCreatorAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 13.3) {
|
||||
DetailNavigationBar(title: "크리에이터 소개")
|
||||
@@ -48,7 +49,10 @@ struct ContentMainIntroduceCreatorAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getIntroduceCreatorList()
|
||||
if !isInitialized {
|
||||
viewModel.getIntroduceCreatorList()
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
@@ -10,9 +10,10 @@ import SwiftUI
|
||||
struct ContentMainReplayAllView: View {
|
||||
|
||||
@StateObject var viewModel = ContentNewAllViewModel()
|
||||
@State private var isInitialized = false
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Group {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
DetailNavigationBar(title: "새로운 라이브 다시듣기")
|
||||
@@ -72,7 +73,14 @@ struct ContentMainReplayAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.selectedTheme = "다시듣기"
|
||||
if !isInitialized {
|
||||
if viewModel.selectedTheme != "다시듣기" {
|
||||
viewModel.selectedTheme = "다시듣기"
|
||||
} else if viewModel.newContentList.isEmpty {
|
||||
viewModel.getNewContentList()
|
||||
}
|
||||
isInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
|
||||
Reference in New Issue
Block a user