From 30c53832982f64ed573bf9866b1709a73484b170 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 26 Jan 2024 20:22:03 -0600 Subject: [PATCH] fix: correct logout confirmation message for single-org --- src/commands/org/logout.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/org/logout.ts b/src/commands/org/logout.ts index 69353d82..57f88087 100644 --- a/src/commands/org/logout.ts +++ b/src/commands/org/logout.ts @@ -134,10 +134,14 @@ const promptForOrgsToRemove = async (orgAuths: OrgAuthorization[], all: boolean) loop: true, }); -const getOrgConfirmationMessage = (selectedOrgs: OrgAuthorization[], originalOrgCount: number): string => - selectedOrgs.length === originalOrgCount +const getOrgConfirmationMessage = (selectedOrgs: OrgAuthorization[], originalOrgCount: number): string => { + if (selectedOrgs.length === 1) { + return messages.getMessage('prompt.confirm.single', [selectedOrgs[0].username]); + } + return selectedOrgs.length === originalOrgCount ? messages.getMessage('prompt.confirm-all') : messages.getMessage('prompt.confirm', [selectedOrgs.length, selectedOrgs.length > 1 ? 's' : '']); +}; /** A whole bunch of custom formatting to make the list look nicer */ const buildChoices = (orgAuths: OrgAuthorization[], all: boolean): Array => {