diff --git a/src/js/components/orgs/cards/orgInfo.tsx b/src/js/components/orgs/cards/orgInfo.tsx
index 03650080a..64d8a8a2f 100644
--- a/src/js/components/orgs/cards/orgInfo.tsx
+++ b/src/js/components/orgs/cards/orgInfo.tsx
@@ -87,7 +87,7 @@ const OrgInfo = ({
// synced status for orgs
if (baseCommit) {
// eslint-disable-next-line max-len
- compareChangesUrl = `${repoUrl}/compare/${org.latest_commit}...${baseCommit}`;
+ compareChangesUrl = `${repoUrl}/compare/${baseCommit}...${org.latest_commit}`;
}
outOfDateMsg = (
diff --git a/src/js/components/orgs/playgroundCard.tsx b/src/js/components/orgs/playgroundCard.tsx
index dca78b228..5d2a2da29 100644
--- a/src/js/components/orgs/playgroundCard.tsx
+++ b/src/js/components/orgs/playgroundCard.tsx
@@ -121,7 +121,6 @@ const PlaygroundOrgCard = ({
const readyToDeleteOrg =
isWaitingToDeleteOrg && !org.currently_refreshing_changes;
const action = isWaitingToDeleteOrg;
-
if (readyToDeleteOrg) {
setIsWaitingToDeleteOrg(null);
if (org.has_unsaved_changes) {
@@ -132,7 +131,16 @@ const PlaygroundOrgCard = ({
doDeleteOrg();
}
}
- }, [doDeleteOrg, doRefreshOrg, isWaitingToDeleteOrg, org]);
+ }, [doDeleteOrg, doRefreshOrg, isWaitingToDeleteOrg, org, dispatch]);
+ useEffect(() => {
+ if (
+ org &&
+ org?.expires_at !== null &&
+ new Date(org?.expires_at) < new Date()
+ ) {
+ doDeleteOrg();
+ }
+ }, []);
/* istanbul ignore next */
if (!(project || epic || task)) {
diff --git a/src/js/components/orgs/taskOrgCard.tsx b/src/js/components/orgs/taskOrgCard.tsx
index 743e6ba34..5ab9671dd 100644
--- a/src/js/components/orgs/taskOrgCard.tsx
+++ b/src/js/components/orgs/taskOrgCard.tsx
@@ -1,6 +1,6 @@
import Card from '@salesforce/design-system-react/components/card';
import classNames from 'classnames';
-import React, { ReactNode, useCallback, useState } from 'react';
+import React, { ReactNode, useCallback, useEffect, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import AssignTaskRoleModal from '@/js/components/githubUsers/assignTaskRole';
@@ -180,6 +180,7 @@ const TaskOrgCard = ({
handleRefresh?.(org);
}
}, [handleRefresh, org]);
+
const doCreateOrg = useCallback(() => {
handleCreate(type);
}, [handleCreate, type]);
@@ -202,7 +203,15 @@ const TaskOrgCard = ({
// We consider an org out-of-date if it is not based on the first commit.
const orgOutOfDate = Boolean(org && orgCommitIdx !== 0);
const testOrgOutOfDate = type === ORG_TYPES.QA && orgOutOfDate;
-
+ useEffect(() => {
+ if (
+ org &&
+ org?.expires_at !== null &&
+ new Date(org?.expires_at) < new Date()
+ ) {
+ doDeleteOrg();
+ }
+ }, []);
return (