feat(FN-4905): complete Step 2 — add lifecycle refresh fallback
Fusion-Task-Id: FN-4905 Fusion-Task-Lineage: 677b6f08-90d7-4785-a0b8-195acc42f79e
This commit is contained in:
committed by
gsxdsm
parent
10455b7992
commit
8bcc381041
@@ -139,12 +139,23 @@ export class NotificationService {
|
||||
}
|
||||
|
||||
private handleTaskMoved = (data: { task: Task; from: Column; to: Column }): void => {
|
||||
void this.maybeSuppressTransientFailedNotification(data.task, `moved to ${data.to}`);
|
||||
void this.handleTaskMovedAsync(data);
|
||||
};
|
||||
|
||||
if (!this.notificationsEnabled || data.to !== "in-review") {
|
||||
private async handleTaskMovedAsync(data: { task: Task; from: Column; to: Column }): Promise<void> {
|
||||
await this.maybeSuppressTransientFailedNotification(data.task, `moved to ${data.to}`);
|
||||
|
||||
if (data.to !== "in-review") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.notificationsEnabled) {
|
||||
await this.refreshNotificationState("task:moved");
|
||||
if (!this.notificationsEnabled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const payload = this.createTaskPayload(data.task, "in-review");
|
||||
this.maybeNotify(data.task.id, "in-review", payload);
|
||||
};
|
||||
@@ -182,10 +193,21 @@ export class NotificationService {
|
||||
};
|
||||
|
||||
private handleTaskMerged = (result: MergeResult): void => {
|
||||
if (!this.notificationsEnabled || !result.merged) {
|
||||
void this.handleTaskMergedAsync(result);
|
||||
};
|
||||
|
||||
private async handleTaskMergedAsync(result: MergeResult): Promise<void> {
|
||||
if (!result.merged) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.notificationsEnabled) {
|
||||
await this.refreshNotificationState("task:merged");
|
||||
if (!this.notificationsEnabled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.maybeNotify(
|
||||
result.task.id,
|
||||
"merged",
|
||||
|
||||
Reference in New Issue
Block a user