Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit f4ed93e

Browse files
maniramezanrnystrom
authored andcommitted
Don’t send haptic if it’s already marked as read (#1917)
This fixes #1893
1 parent 765ee24 commit f4ed93e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Classes/Notifications/NotificationSectionController.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ final class NotificationSectionController: ListSwiftSectionController<Notificati
4242
}
4343

4444
func didTapRead(cell: NotificationCell) {
45-
guard let id = value?.id else { return }
45+
guard
46+
let id = value?.id,
47+
let model = modelController.githubClient.cache.get(id: id) as NotificationViewModel?,
48+
!model.read
49+
else {
50+
return
51+
}
4652
generator.impactOccurred()
4753
modelController.markNotificationRead(id: id)
4854
}

0 commit comments

Comments
 (0)