fix: getActiveKey is refactoring into switch

This commit is contained in:
Palash gupta 2022-05-20 14:12:13 +05:30
parent 1315b43aad
commit c77ad88f90
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6

View File

@ -55,19 +55,20 @@ function ServiceMetrics(): JSX.Element {
const externalMetrics = 'External Calls'; const externalMetrics = 'External Calls';
const getActiveKey = (): string => { const getActiveKey = (): string => {
if (tab === null) { switch (tab) {
return overMetrics; case null: {
return overMetrics;
}
case dbCallMetrics: {
return dbCallMetrics;
}
case externalMetrics: {
return externalMetrics;
}
default: {
return overMetrics;
}
} }
if (tab === dbCallMetrics) {
return dbCallMetrics;
}
if (tab === externalMetrics) {
return externalMetrics;
}
return overMetrics;
}; };
const activeKey = getActiveKey(); const activeKey = getActiveKey();