From 13dd0851c727c707ad1439b2a707a8f25e4e7d19 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 11 Oct 2023 17:42:12 -0500 Subject: [PATCH] refactor: set configs username prop, no mutating --- src/org/org.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/org.ts b/src/org/org.ts index be6d753d7a..08a5880bb8 100644 --- a/src/org/org.ts +++ b/src/org/org.ts @@ -798,13 +798,13 @@ export class Org extends AsyncOptionalCreatable { this.logger.debug(`removing username ${authInfo.getFields().username}`); const orgConfig: OrgUsersConfig = await this.retrieveOrgUsersConfig(); - - const contents: ConfigContents = await orgConfig.read(); + const contents = await orgConfig.read(); const targetUser = authInfo.getFields().username; - const usernames = (contents.usernames ?? []) as string[]; - contents.usernames = usernames.filter((username) => username !== targetUser); + const usernames = (contents.usernames ?? []).filter((username) => username !== targetUser); + + orgConfig.set('usernames', usernames); await orgConfig.write(); return this; }