Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
f1cbd5f6a1
commit
319bad27a1
@ -1962,6 +1962,9 @@
|
||||
"Release shoulder tension" : {
|
||||
"comment" : "Habit title for releasing shoulder tension during mindfulness practice.",
|
||||
"isCommentAutoGenerated" : true
|
||||
},
|
||||
"Reload Widget Timelines" : {
|
||||
|
||||
},
|
||||
"Remaining" : {
|
||||
"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
|
||||
if newPhase == .active {
|
||||
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)
|
||||
if useDebugOverlay {
|
||||
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(
|
||||
showOverlay: true,
|
||||
showOverlay: useDebugOverlay,
|
||||
minimumSeconds: useDebugOverlay ? debugForegroundRefreshMinimumSeconds : foregroundRefreshMinimumSeconds
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import SwiftUI
|
||||
import Bedrock
|
||||
import WidgetKit
|
||||
|
||||
struct SettingsView: View {
|
||||
@Bindable var store: SettingsStore
|
||||
@ -173,6 +174,14 @@ struct SettingsView: View {
|
||||
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 {
|
||||
TimeOfDayDebugPicker(store: ritualStore)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user