Skip to content

Commit

Permalink
fix: create policyToDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
truph01 committed Nov 13, 2024
1 parent 6f8b04e commit 90e4e00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ function WorkspacesListPage() {
const workspaceAccountID = PolicyUtils.getWorkspaceAccountID(policyIDToDelete ?? '-1');
const [cardFeeds] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`);
const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${CONST.EXPENSIFY_CARD.BANK}`);
const policyToDelete = PolicyUtils.getPolicy(policyIDToDelete);
const hasCardFeedOrExpensifyCard =
!isEmptyObject(cardFeeds) ||
!isEmptyObject(cardsList) ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
((PolicyUtils.getPolicy(policyIDToDelete)?.areExpensifyCardsEnabled || PolicyUtils.getPolicy(policyIDToDelete)?.areCompanyCardsEnabled) &&
PolicyUtils.getPolicy(policyIDToDelete)?.workspaceAccountID);
((policyToDelete?.areExpensifyCardsEnabled || policyToDelete?.areCompanyCardsEnabled) && policyToDelete?.workspaceAccountID);

const confirmDeleteAndHideModal = () => {
if (!policyIDToDelete || !policyNameToDelete) {
Expand Down

0 comments on commit 90e4e00

Please sign in to comment.