Skip to content

Commit f0c790e

Browse files
authored
Don't notify the user executing the project transition (#3261)
1 parent 6c6b8e0 commit f0c790e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/project/workflow/handlers/project-workflow-notification.handler.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class ProjectWorkflowNotificationHandler
3737
) {}
3838

3939
async handle(event: ProjectTransitionedEvent) {
40-
const { previousStep, next, workflowEvent } = event;
40+
const { previousStep, next, workflowEvent, session } = event;
4141
const transition = typeof next !== 'string' ? next : undefined;
4242

4343
// TODO on bypass: keep notifying members? add anyone else?
@@ -46,7 +46,15 @@ export class ProjectWorkflowNotificationHandler
4646
const params = { project: event.project, moduleRef: this.moduleRef };
4747
const notifyees = (
4848
await Promise.all(notifiers.map((notifier) => notifier.resolve(params)))
49-
).flat();
49+
)
50+
.flat()
51+
.filter(
52+
(n) =>
53+
// Not current user
54+
n.id !== session.userId &&
55+
// Only email notifications right now
56+
n.email,
57+
);
5058

5159
if (notifyees.length === 0) {
5260
return;

0 commit comments

Comments
 (0)