Merge pull request #1179 from palash-signoz/metrics-application-active-key

fix: getActiveKey is refactoring into switch
This commit is contained in:
palash-signoz 2022-05-20 15:45:49 +05:30 committed by GitHub
commit 3ba519457a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {
case null: {
return overMetrics; return overMetrics;
} }
case dbCallMetrics: {
if (tab === dbCallMetrics) {
return dbCallMetrics; return dbCallMetrics;
} }
case externalMetrics: {
if (tab === externalMetrics) {
return externalMetrics; return externalMetrics;
} }
default: {
return overMetrics; return overMetrics;
}
}
}; };
const activeKey = getActiveKey(); const activeKey = getActiveKey();