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 {
|
||||
hiddenSceneView
|
||||
mainView
|
||||
.onAppear(perform: presentActiveProfile)
|
||||
|
||||
if !profileManager.hasProfiles {
|
||||
emptyView
|
||||
}
|
||||
|
@ -207,8 +209,6 @@ struct OrganizerView: View {
|
|||
profileLabel(forHeader: header)
|
||||
}.contextMenu {
|
||||
profileMenu(forHeader: header)
|
||||
}.onAppear {
|
||||
presentIfActiveProfile(header.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,13 +338,6 @@ extension OrganizerView {
|
|||
}
|
||||
|
||||
extension OrganizerView {
|
||||
private func presentIfActiveProfile(_ id: UUID) {
|
||||
guard id == profileManager.activeHeader?.id else {
|
||||
return
|
||||
}
|
||||
presentActiveProfile()
|
||||
}
|
||||
|
||||
private func presentActiveProfile() {
|
||||
guard isFirstLaunch else {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue