Fix active profile flickering on first launch
Move .onAppear() handler to main view.
This commit is contained in:
parent
3571c7db35
commit
472b5e4b41
|
@ -125,6 +125,8 @@ struct OrganizerView: View {
|
||||||
return ZStack {
|
return ZStack {
|
||||||
hiddenSceneView
|
hiddenSceneView
|
||||||
mainView
|
mainView
|
||||||
|
.onAppear(perform: presentActiveProfile)
|
||||||
|
|
||||||
if !profileManager.hasProfiles {
|
if !profileManager.hasProfiles {
|
||||||
emptyView
|
emptyView
|
||||||
}
|
}
|
||||||
|
@ -207,8 +209,6 @@ struct OrganizerView: View {
|
||||||
profileLabel(forHeader: header)
|
profileLabel(forHeader: header)
|
||||||
}.contextMenu {
|
}.contextMenu {
|
||||||
profileMenu(forHeader: header)
|
profileMenu(forHeader: header)
|
||||||
}.onAppear {
|
|
||||||
presentIfActiveProfile(header.id)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,13 +338,6 @@ extension OrganizerView {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension OrganizerView {
|
extension OrganizerView {
|
||||||
private func presentIfActiveProfile(_ id: UUID) {
|
|
||||||
guard id == profileManager.activeHeader?.id else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
presentActiveProfile()
|
|
||||||
}
|
|
||||||
|
|
||||||
private func presentActiveProfile() {
|
private func presentActiveProfile() {
|
||||||
guard isFirstLaunch else {
|
guard isFirstLaunch else {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue