@@ -18,6 +18,7 @@ import {
18
18
LabelRequestEventType ,
19
19
MessageRequestEventType ,
20
20
MessageResponseEventType ,
21
+ type NotificationContextRemovedEvent ,
21
22
type NotificationContextUpdatedEvent ,
22
23
NotificationRequestEventType ,
23
24
NotificationResponseEventType ,
@@ -165,6 +166,24 @@ async function onNotificationContextUpdated(
165
166
return result
166
167
}
167
168
169
+ async function onNotificationContextRemoved (
170
+ ctx : TriggerCtx ,
171
+ event : NotificationContextRemovedEvent
172
+ ) : Promise < RequestEvent [ ] > {
173
+ const { context } = event
174
+
175
+ const result : RequestEvent [ ] = [ ]
176
+
177
+ result . push ( {
178
+ type : LabelRequestEventType . RemoveLabel ,
179
+ label : NewMessageLabelID ,
180
+ card : context . card ,
181
+ account : context . account
182
+ } )
183
+
184
+ return result
185
+ }
186
+
168
187
async function onMessagesRemoved ( ctx : TriggerCtx , event : PatchCreatedEvent ) : Promise < RequestEvent [ ] > {
169
188
if ( event . patch . type !== PatchType . remove ) return [ ]
170
189
@@ -196,6 +215,11 @@ const triggers: Triggers = [
196
215
NotificationResponseEventType . NotificationContextUpdated ,
197
216
onNotificationContextUpdated as TriggerFn
198
217
] ,
218
+ [
219
+ 'on_notification_context_removed' ,
220
+ NotificationResponseEventType . NotificationContextRemoved ,
221
+ onNotificationContextRemoved as TriggerFn
222
+ ] ,
199
223
[ 'on_added_collaborators' , NotificationResponseEventType . AddedCollaborators , onAddedCollaborators as TriggerFn ] ,
200
224
[ 'on_removed_collaborators' , NotificationResponseEventType . RemovedCollaborators , onRemovedCollaborators as TriggerFn ] ,
201
225
[ 'remove_notifications_on_messages_removed' , MessageResponseEventType . PatchCreated , onMessagesRemoved as TriggerFn ]
0 commit comments