Skip to content

Commit

Permalink
Merge pull request #68 from AnonymousAlt0/64-notifications
Browse files Browse the repository at this point in the history
fix: fixed 'Finished' notification appearing after manually cancelling timer
  • Loading branch information
othyn authored Jul 1, 2023
2 parents 10c2d68 + 2545fc8 commit 3826d55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions auto-clicker/Observable Objects/AutoClickSimulator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ final class AutoClickSimulator: ObservableObject {
if let timer = self.timer {
timer.invalidate()
}

NotificationService.removePendingNotifications()
}

@objc private func tick() {
Expand Down
4 changes: 4 additions & 0 deletions auto-clicker/Services/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ final class NotificationService: ObservableObject {

UNUserNotificationCenter.current().add(request)
}

static func removePendingNotifications() {
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
}
}

0 comments on commit 3826d55

Please sign in to comment.