@@ -101,7 +101,7 @@ final class NotificationModelController {
101
101
return
102
102
}
103
103
104
- let content = " state comments{totalCount} "
104
+ let content = " state comments{totalCount} viewerSubscription "
105
105
let notificationQueries : String = notifications. compactMap {
106
106
guard let alias = $0. stateAlias else { return nil }
107
107
return """
@@ -124,10 +124,12 @@ final class NotificationModelController {
124
124
let stateString = issueOrPullRequest [ " state " ] as? String ,
125
125
let state = NotificationViewModel . State ( rawValue: stateString) ,
126
126
let commentsJSON = issueOrPullRequest [ " comments " ] as? [ String : Any ] ,
127
- let commentCount = commentsJSON [ " totalCount " ] as? Int {
127
+ let commentCount = commentsJSON [ " totalCount " ] as? Int ,
128
+ let subscription = issueOrPullRequest [ " viewerSubscription " ] as? String {
128
129
var newNotification = notification
129
130
newNotification. state = state
130
131
newNotification. comments = commentCount
132
+ newNotification. watching = subscription != " IGNORED "
131
133
updatedNotifications. append ( newNotification)
132
134
} else {
133
135
updatedNotifications. append ( notification)
@@ -186,7 +188,7 @@ final class NotificationModelController {
186
188
model. watching = !notification. watching
187
189
cache. set ( value: model)
188
190
189
- githubClient. client. send ( V3SubscribeThreadRequest ( id: model. v3id, ignore: model. watching) ) { result in
191
+ githubClient. client. send ( V3SubscribeThreadRequest ( id: model. v3id, ignore: ! model. watching) ) { result in
190
192
switch result {
191
193
case . success:
192
194
Haptic . triggerSelection ( )
0 commit comments