@tapcart/mobile-components 0.8.27 → 0.8.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,8 +17,8 @@ function SubCollectionTabs({ subCollections, useActions, }) {
|
|
|
17
17
|
})), [subCollections]);
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
// Set initial active tab based on URL params
|
|
20
|
-
const collectionId = searchParams.get("collectionId");
|
|
21
|
-
const collectionHandle = searchParams.get("collectionHandle");
|
|
20
|
+
const collectionId = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("collectionId");
|
|
21
|
+
const collectionHandle = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("collectionHandle");
|
|
22
22
|
const initialIndex = subCollections.findIndex((cat) => (collectionId && getIdFromGid(cat.id) === collectionId) ||
|
|
23
23
|
(collectionHandle && cat.handle === collectionHandle));
|
|
24
24
|
setActiveTab(initialIndex !== -1 ? initialIndex : null);
|