Skip to content

Commit 7e2db88

Browse files
committed
Remove redundant existence checks
Also remove a ? since that condition would short-circuit if `secrets` was not set. We could just do a falsey check, but I like to compare length to a number.
1 parent 35978ed commit 7e2db88

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/EditOAuth2AppPageView.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const OAuth2AppSecretsTable: FC<OAuth2AppSecretsTableProps> = ({
225225
</TableHead>
226226
<TableBody>
227227
{isLoadingSecrets && <TableLoader />}
228-
{!isLoadingSecrets && (!secrets || secrets?.length === 0) && (
228+
{!isLoadingSecrets && (!secrets || secrets.length === 0) && (
229229
<TableRow>
230230
<TableCell colSpan={999}>
231231
<div css={{ textAlign: "center" }}>
@@ -235,8 +235,6 @@ const OAuth2AppSecretsTable: FC<OAuth2AppSecretsTableProps> = ({
235235
</TableRow>
236236
)}
237237
{!isLoadingSecrets &&
238-
secrets &&
239-
secrets?.length > 0 &&
240238
secrets?.map((secret) => (
241239
<OAuth2SecretRow
242240
key={secret.id}

0 commit comments

Comments
 (0)