Fixes undismissable live timer

main
Laurent 3 years ago
parent 51b617f333
commit 09cd5815f2
  1. 17
      LeCountdown/Views/ContentView.swift
  2. 4
      LeCountdown/Views/LiveTimerListView.swift

@ -32,9 +32,6 @@ struct ContentView<T : AbstractTimer>: View {
@State private var showSettingsSheet: Bool = false @State private var showSettingsSheet: Bool = false
@State private var showStatsSheet: Bool = false @State private var showStatsSheet: Bool = false
// @State private var showAddSheet: Bool = false
// @State private var showTimerSheet: Bool = false
// @State private var showStopwatchSheet: Bool = false
@State private var showSubscriptionSheet: Bool = false @State private var showSubscriptionSheet: Bool = false
@ -78,16 +75,12 @@ struct ContentView<T : AbstractTimer>: View {
} }
.sheet(isPresented: self.$boringContext.isShowingNewData, content: { .sheet(isPresented: self.$boringContext.isShowingNewData, content: {
}) })
// .sheet(isPresented: self.$showAddSheet, content: {
// NewCountdownView(isPresented: $showAddSheet, tabSelection: .constant(0))
// .environment(\.managedObjectContext, viewContext)
// })
.toolbar { .toolbar {
if Conductor.maestro.memoryWarningReceived { // if Conductor.maestro.memoryWarningReceived {
ToolbarItemGroup(placement: .navigationBarTrailing) { // ToolbarItemGroup(placement: .navigationBarTrailing) {
Image(systemName: "circle.fill").font(.caption2).foregroundColor(.orange) // Image(systemName: "circle.fill").font(.caption2).foregroundColor(.orange)
} // }
} // }
MainToolbarView(isEditing: self.$isEditing) MainToolbarView(isEditing: self.$isEditing)
} }
.onAppear { .onAppear {

@ -102,7 +102,7 @@ struct LiveStopwatchView: View {
let duration = self.endDate?.timeIntervalSince(self.date) ?? 0.0 let duration = self.endDate?.timeIntervalSince(self.date) ?? 0.0
TimeView(text: duration.hourMinuteSecondHS) TimeView(text: duration.hourMinuteSecondHS)
} }
Text(stopwatch.displayName.uppercased()) Text(self.stopwatch.displayName.uppercased())
} }
Spacer() Spacer()
@ -204,7 +204,7 @@ struct LiveCountdownView: View {
} }
.contentShape(Rectangle()) .contentShape(Rectangle())
.onTapGesture { .onTapGesture {
if Conductor.maestro.isCountdownCancelled(self.countdown) { if Date() > self.date || Conductor.maestro.isCountdownCancelled(self.countdown) {
self._dismiss() self._dismiss()
} }
} }

Loading…
Cancel
Save