Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
f1cbd5f6a1
commit
319bad27a1
@ -1962,6 +1962,9 @@
|
|||||||
"Release shoulder tension" : {
|
"Release shoulder tension" : {
|
||||||
"comment" : "Habit title for releasing shoulder tension during mindfulness practice.",
|
"comment" : "Habit title for releasing shoulder tension during mindfulness practice.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
|
},
|
||||||
|
"Reload Widget Timelines" : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"Remaining" : {
|
"Remaining" : {
|
||||||
"comment" : "Label for the number of days remaining in a ritual's progress.",
|
"comment" : "Label for the number of days remaining in a ritual's progress.",
|
||||||
|
|||||||
@ -90,12 +90,20 @@ struct RootView: View {
|
|||||||
.onChange(of: scenePhase) { _, newPhase in
|
.onChange(of: scenePhase) { _, newPhase in
|
||||||
if newPhase == .active {
|
if newPhase == .active {
|
||||||
store.reminderScheduler.clearBadge()
|
store.reminderScheduler.clearBadge()
|
||||||
|
|
||||||
|
// Update time-of-day immediately (synchronously) before any UI refresh.
|
||||||
|
// This ensures the correct rituals are shown without a visible transition.
|
||||||
|
store.updateCurrentTimeOfDay()
|
||||||
|
|
||||||
let useDebugOverlay = UserDefaults.standard.bool(forKey: debugForegroundRefreshKey)
|
let useDebugOverlay = UserDefaults.standard.bool(forKey: debugForegroundRefreshKey)
|
||||||
if useDebugOverlay {
|
if useDebugOverlay {
|
||||||
UserDefaults.standard.set(false, forKey: debugForegroundRefreshKey)
|
UserDefaults.standard.set(false, forKey: debugForegroundRefreshKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only show overlay for debug refreshes. Normal foreground refreshes
|
||||||
|
// happen silently to avoid jarring transitions when crossing time boundaries.
|
||||||
refreshAllTabs(
|
refreshAllTabs(
|
||||||
showOverlay: true,
|
showOverlay: useDebugOverlay,
|
||||||
minimumSeconds: useDebugOverlay ? debugForegroundRefreshMinimumSeconds : foregroundRefreshMinimumSeconds
|
minimumSeconds: useDebugOverlay ? debugForegroundRefreshMinimumSeconds : foregroundRefreshMinimumSeconds
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Bedrock
|
import Bedrock
|
||||||
|
import WidgetKit
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@Bindable var store: SettingsStore
|
@Bindable var store: SettingsStore
|
||||||
@ -173,6 +174,14 @@ struct SettingsView: View {
|
|||||||
UserDefaults.standard.set(true, forKey: "debugForegroundRefreshNextForeground")
|
UserDefaults.standard.set(true, forKey: "debugForegroundRefreshNextForeground")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsRow(
|
||||||
|
systemImage: "widget.small",
|
||||||
|
title: String(localized: "Reload Widget Timelines"),
|
||||||
|
iconColor: AppAccent.primary
|
||||||
|
) {
|
||||||
|
WidgetCenter.shared.reloadAllTimelines()
|
||||||
|
}
|
||||||
|
|
||||||
if let ritualStore {
|
if let ritualStore {
|
||||||
TimeOfDayDebugPicker(store: ritualStore)
|
TimeOfDayDebugPicker(store: ritualStore)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user