From 8a3929775b5ce99436642f6238046fef1099ec46 Mon Sep 17 00:00:00 2001 From: vaidankarswapnil <81285216+vaidankarswapnil@users.noreply.github.com> Date: Thu, 15 Jul 2021 21:24:07 +0530 Subject: [PATCH] Strict mode SwitchAccount and SwitchSubscription files (#940) --- src/Platform/Hosted/Components/SwitchAccount.tsx | 2 +- src/Platform/Hosted/Components/SwitchSubscription.tsx | 2 +- tsconfig.strict.json | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Platform/Hosted/Components/SwitchAccount.tsx b/src/Platform/Hosted/Components/SwitchAccount.tsx index 0462f2188..ef195ee07 100644 --- a/src/Platform/Hosted/Components/SwitchAccount.tsx +++ b/src/Platform/Hosted/Components/SwitchAccount.tsx @@ -26,7 +26,7 @@ export const SwitchAccount: FunctionComponent = ({ data: account, }))} onChange={(_, option) => { - setSelectedAccountName(String(option.key)); + setSelectedAccountName(String(option?.key)); dismissMenu(); }} defaultSelectedKey={selectedAccount?.name} diff --git a/src/Platform/Hosted/Components/SwitchSubscription.tsx b/src/Platform/Hosted/Components/SwitchSubscription.tsx index 9ec98fc27..c784c5f5b 100644 --- a/src/Platform/Hosted/Components/SwitchSubscription.tsx +++ b/src/Platform/Hosted/Components/SwitchSubscription.tsx @@ -26,7 +26,7 @@ export const SwitchSubscription: FunctionComponent = ({ }; })} onChange={(_, option) => { - setSelectedSubscriptionId(String(option.key)); + setSelectedSubscriptionId(String(option?.key)); }} defaultSelectedKey={selectedSubscription?.subscriptionId} placeholder={subscriptions && subscriptions.length === 0 ? "No Subscriptions Found" : "Select a Subscription"} diff --git a/tsconfig.strict.json b/tsconfig.strict.json index ade4b2017..6a9a6e78a 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -140,7 +140,9 @@ "./src/quickstart.ts", "./src/setupTests.ts", "./src/userContext.test.ts", - "src/Common/EntityValue.tsx" + "src/Common/EntityValue.tsx", + "./src/Platform/Hosted/Components/SwitchAccount.tsx", + "./src/Platform/Hosted/Components/SwitchSubscription.tsx", ], "include": [ "src/CellOutputViewer/transforms/**/*",