pcs/SOURCES/simplify-ternar-expression....

27 lines
811 B
Diff

From f44cdc871a39da3960bd04565b4d1d5ffa19bd23 Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Thu, 20 Jan 2022 13:32:49 +0100
Subject: [PATCH 1/2] simplify ternar expression
The motivation for this is that covscan complains about it.
---
src/app/view/share/useUrlTabs.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/view/share/useUrlTabs.ts b/src/app/view/share/useUrlTabs.ts
index 7278dad8..a1136bf3 100644
--- a/src/app/view/share/useUrlTabs.ts
+++ b/src/app/view/share/useUrlTabs.ts
@@ -13,7 +13,7 @@ export const useUrlTabs = <TABS extends ReadonlyArray<string>>(
return {
currentTab,
- matchedContext: tab !== null ? tab.matched : `/${defaultTab}`,
+ matchedContext: tab?.matched ?? `/${defaultTab}`,
tabList,
};
};
--
2.31.1