Fix slow active profile selection on launch
Regression due to missing .stack navigation style basically. Restore .onAppear() on NavigationLink.
This commit is contained in:
parent
75650b1f0a
commit
576eb1512a
|
@ -52,6 +52,7 @@ extension View {
|
|||
let color = themeAccentColor
|
||||
return accentColor(color)
|
||||
.toggleStyle(SwitchToggleStyle(tint: color))
|
||||
.themeNavigationViewStyle()
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -125,8 +125,6 @@ struct OrganizerView: View {
|
|||
return ZStack {
|
||||
hiddenSceneView
|
||||
mainView
|
||||
.onAppear(perform: presentActiveProfile)
|
||||
|
||||
if !profileManager.hasProfiles {
|
||||
emptyView
|
||||
}
|
||||
|
@ -209,6 +207,8 @@ struct OrganizerView: View {
|
|||
profileLabel(forHeader: header)
|
||||
}.contextMenu {
|
||||
profileMenu(forHeader: header)
|
||||
}.onAppear {
|
||||
presentIfActiveProfile(header.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,6 +338,13 @@ 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