okay i got it to work

had to enable bg modes and stuff
and made it call on appear of the shell and not the tab strip 💀
This commit is contained in:
neon443 committed 2025-08-24 21:00:59 +01:00
1 parent a7783eab47
commit d4f31fda32
3 files changed
+16 -11

No files matched your search

+4
View File
@@ -22,5 +22,9 @@
<string>JetBrainsMonoNerdFontMono-Italic.ttf</string>
<string>JetBrainsMonoNerdFontMono-BoldItalic.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
</dict>
</plist>
+2 -1
View File
@@ -23,6 +23,7 @@ class Backgrounder: NSObject, CLLocationManagerDelegate, ObservableObject {
}
func startBgTracking() {
// guard mana
manager.allowsBackgroundLocationUpdates = true
manager.pausesLocationUpdatesAutomatically = false
manager.startMonitoringSignificantLocationChanges()
@@ -53,6 +54,6 @@ class Backgrounder: NSObject, CLLocationManagerDelegate, ObservableObject {
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
print("tracking started yay")
print("tracking started fr")
}
}
+10 -10
View File
@@ -149,12 +149,6 @@ struct ShellTabView: View {
}
}
.frame(height: 30)
.onDisappear {
UIApplication.shared.isIdleTimerDisabled = false
if container.sessions.isEmpty {
Backgrounder.shared.stopBgTracking()
}
}
.onAppear {
if selectedID == nil {
if let handler {
@@ -163,10 +157,6 @@ struct ShellTabView: View {
dismiss()
}
}
UIApplication.shared.isIdleTimerDisabled = hostsManager.settings.caffeinate
if hostsManager.settings.locationPersist {
Backgrounder.shared.startBgTracking()
}
}
}
@@ -177,6 +167,12 @@ struct ShellTabView: View {
handler: session.handler,
hostsManager: hostsManager
)
.onAppear {
UIApplication.shared.isIdleTimerDisabled = hostsManager.settings.caffeinate
if hostsManager.settings.locationPersist {
Backgrounder.shared.startBgTracking()
}
}
.onDisappear {
if !checkShell(session.handler.state) {
if let lastSession = container.sessionIDs.last {
@@ -185,6 +181,10 @@ struct ShellTabView: View {
dismiss()
}
}
UIApplication.shared.isIdleTimerDisabled = false
if container.sessions.isEmpty {
Backgrounder.shared.stopBgTracking()
}
}
.id(selectedID)
.transition(.opacity)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.