Hopefully fix some weird issues

This commit is contained in:
Stephen 2026-05-20 10:07:09 -04:00
parent f9c1f46fad
commit ec147679e1
49 changed files with 2458 additions and 2287 deletions

View file

@ -8,10 +8,6 @@
import SwiftUI
import Foundation
extension Notification.Name {
static let switchToTab = Notification.Name("MainTabSwitchNotification")
}
private enum ExternalLocationAction: Identifiable {
case simulate(URL, Double, Double)
case clear
@ -55,7 +51,6 @@ private enum ExternalLocationAction: Identifiable {
struct MainTabView: View {
@AppStorage("primaryTabSelection") private var selection: String = AppFeature.home.id
@State private var switchObserver: Any?
@State private var detachedFeature: AppFeature?
@State private var didSetInitialHome = false
@State private var pendingLocationAction: ExternalLocationAction?
@ -77,17 +72,6 @@ struct MainTabView: View {
selection = AppFeature.home.id
didSetInitialHome = true
}
guard switchObserver == nil else { return }
switchObserver = NotificationCenter.default.addObserver(forName: .switchToTab, object: nil, queue: .main) { note in
guard let id = note.object as? String else { return }
openFeature(id: id)
}
}
.onDisappear {
if let observer = switchObserver {
NotificationCenter.default.removeObserver(observer)
switchObserver = nil
}
}
.onOpenURL { url in
handleURL(url)