Skip to content

Commit

Permalink
Merge pull request #301 from aapis/feature/1.12/soften-ui
Browse files Browse the repository at this point in the history
Bug fix: Notifications not cleared properly
  • Loading branch information
aapis authored Oct 15, 2024
2 parents 581590f + 3f571f1 commit b9f1363
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions KWCore/Sources/Query/CoreDataTasks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ public class CoreDataTasks {
public func complete(_ task: LogTask) -> Void {
task.completedDate = Date()
task.lastUpdate = Date()

task.hasScheduledNotification = false
NotificationHelper.clean(identifier: task.id?.uuidString ?? "no-id")

do {
try moc!.save()

Expand Down Expand Up @@ -278,7 +280,9 @@ public class CoreDataTasks {
public func cancel(_ task: LogTask) -> Void {
task.cancelledDate = Date()
task.lastUpdate = Date()

task.hasScheduledNotification = false
NotificationHelper.clean(identifier: task.id?.uuidString ?? "no-id")

do {
try moc!.save()

Expand All @@ -299,6 +303,7 @@ public class CoreDataTasks {
/// - Returns: Void
public func due(on date: Date, task: LogTask) -> Void {
task.due = date
task.hasScheduledNotification = true

do {
try moc!.save()
Expand Down

0 comments on commit b9f1363

Please sign in to comment.