1.03 for iOS and 1.5.0 for Android

This commit is contained in:
2025-09-27 02:13:51 -06:00
parent b6dded50d9
commit 346f1a438e
16 changed files with 1708 additions and 1271 deletions

View File

@@ -114,7 +114,7 @@ struct ActiveSessionBanner: View {
@State private var currentTime = Date()
@State private var navigateToDetail = false
private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
@State private var timer: Timer?
var body: some View {
HStack {
@@ -162,8 +162,11 @@ struct ActiveSessionBanner: View {
.fill(.green.opacity(0.1))
.stroke(.green.opacity(0.3), lineWidth: 1)
)
.onReceive(timer) { _ in
currentTime = Date()
.onAppear {
startTimer()
}
.onDisappear {
stopTimer()
}
.background(
NavigationLink(
@@ -190,6 +193,17 @@ struct ActiveSessionBanner: View {
return String(format: "%ds", seconds)
}
}
private func startTimer() {
timer = Timer.scheduledTimer(withTimeInterval: 5.0, repeats: true) { _ in
currentTime = Date()
}
}
private func stopTimer() {
timer?.invalidate()
timer = nil
}
}
struct SessionRow: View {