Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
46c9461e58
commit
963371d619
@ -7,7 +7,7 @@
|
|||||||
<key>Andromida.xcscheme_^#shared#^_</key>
|
<key>Andromida.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>2</integer>
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
@ -53,6 +53,9 @@ final class ReminderScheduler: NSObject, UNUserNotificationCenterDelegate {
|
|||||||
private(set) var authorizationStatus: UNAuthorizationStatus = .notDetermined
|
private(set) var authorizationStatus: UNAuthorizationStatus = .notDetermined
|
||||||
private(set) var scheduledSlots: Set<ReminderSlot> = []
|
private(set) var scheduledSlots: Set<ReminderSlot> = []
|
||||||
|
|
||||||
|
/// Set to true when user taps a notification - observe in RootView to navigate
|
||||||
|
var shouldNavigateToToday = false
|
||||||
|
|
||||||
/// Whether reminders are enabled by the user
|
/// Whether reminders are enabled by the user
|
||||||
var remindersEnabled: Bool {
|
var remindersEnabled: Bool {
|
||||||
get { UserDefaults.standard.bool(forKey: "remindersEnabled") }
|
get { UserDefaults.standard.bool(forKey: "remindersEnabled") }
|
||||||
@ -95,6 +98,7 @@ final class ReminderScheduler: NSObject, UNUserNotificationCenterDelegate {
|
|||||||
print("🔔 Notification received/tapped: \(response.notification.request.identifier)")
|
print("🔔 Notification received/tapped: \(response.notification.request.identifier)")
|
||||||
// Clear badge when user interacts with notification
|
// Clear badge when user interacts with notification
|
||||||
clearBadge()
|
clearBadge()
|
||||||
|
shouldNavigateToToday = true
|
||||||
completionHandler()
|
completionHandler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,12 @@ struct RootView: View {
|
|||||||
.onChange(of: selectedTab) { _, _ in
|
.onChange(of: selectedTab) { _, _ in
|
||||||
refreshCurrentTab()
|
refreshCurrentTab()
|
||||||
}
|
}
|
||||||
|
.onChange(of: store.reminderScheduler.shouldNavigateToToday) { _, shouldNavigate in
|
||||||
|
if shouldNavigate {
|
||||||
|
selectedTab = .today
|
||||||
|
store.reminderScheduler.shouldNavigateToToday = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func refreshCurrentTab() {
|
private func refreshCurrentTab() {
|
||||||
|
|||||||
BIN
Andromida/Assets.xcassets/AppIcon.appiconset/AppIcon-1024px.png
Normal file
BIN
Andromida/Assets.xcassets/AppIcon.appiconset/AppIcon-1024px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 292 KiB |
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
|
"filename" : "AppIcon-1024px.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"platform" : "ios",
|
"platform" : "ios",
|
||||||
"size" : "1024x1024"
|
"size" : "1024x1024"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user