Skip to content

Commit 58faac4

Browse files
committed
refactor: drop redundant orglist length guard in resubscribe check
The check ran inside a loop over the orglist, so the length guard was always true. The empty-list safety guard lives in unsubscribeOrgsNotInOrgList where it is actually needed.
1 parent a09cdec commit 58faac4

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/tasks/sync-default-organizations-v2.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ const task = new Task('sync-default-organizations-v2', async () => {
5656
pending.push(orgUid);
5757
} else {
5858
imported.push(orgUid);
59-
if (
60-
onlyCadtSubscriptions &&
61-
defaultOrgList.length > 0 &&
62-
!Boolean(organization.subscribed)
63-
) {
59+
if (onlyCadtSubscriptions && !organization.subscribed) {
6460
resubscribePending.push(orgUid);
6561
}
6662
}

src/tasks/sync-default-organizations.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ const task = new Task('sync-default-organizations', async () => {
5656
pending.push(orgUid);
5757
} else {
5858
imported.push(orgUid);
59-
if (
60-
onlyCadtSubscriptions &&
61-
defaultOrgRecords.length > 0 &&
62-
!Boolean(organization.subscribed)
63-
) {
59+
if (onlyCadtSubscriptions && !organization.subscribed) {
6460
resubscribePending.push(orgUid);
6561
}
6662
}

0 commit comments

Comments
 (0)