From 7546512105bd916e00fbba9e0a292045a37b8a93 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Tue, 4 Jun 2024 19:39:09 -0400 Subject: [PATCH] fix: isTabbedNavigationConfig checks for tabsV2 (#962) --- packages/fdr-sdk/src/client/visitDbNavigationConfig.ts | 5 ++++- packages/fdr-sdk/src/client/visitWriteNavigationConfig.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/fdr-sdk/src/client/visitDbNavigationConfig.ts b/packages/fdr-sdk/src/client/visitDbNavigationConfig.ts index cf5d6ebedb..bd021817b7 100644 --- a/packages/fdr-sdk/src/client/visitDbNavigationConfig.ts +++ b/packages/fdr-sdk/src/client/visitDbNavigationConfig.ts @@ -39,5 +39,8 @@ function isVersionedNavigationConfig(config: DocsV1Db.NavigationConfig): config export function isTabbedNavigationConfig( config: DocsV1Db.UnversionedNavigationConfig, ): config is DocsV1Db.UnversionedTabbedNavigationConfig { - return Array.isArray((config as DocsV1Db.UnversionedTabbedNavigationConfig).tabs); + return ( + Array.isArray((config as DocsV1Db.UnversionedTabbedNavigationConfig).tabs) || + Array.isArray((config as DocsV1Db.UnversionedTabbedNavigationConfig).tabsV2) + ); } diff --git a/packages/fdr-sdk/src/client/visitWriteNavigationConfig.ts b/packages/fdr-sdk/src/client/visitWriteNavigationConfig.ts index 8b11859b69..8a30ac2782 100644 --- a/packages/fdr-sdk/src/client/visitWriteNavigationConfig.ts +++ b/packages/fdr-sdk/src/client/visitWriteNavigationConfig.ts @@ -41,5 +41,8 @@ function isVersionedNavigationConfig( export function isTabbedNavigationConfig( config: DocsV1Write.UnversionedNavigationConfig, ): config is DocsV1Write.UnversionedTabbedNavigationConfig { - return Array.isArray((config as DocsV1Write.UnversionedTabbedNavigationConfig).tabs); + return ( + Array.isArray((config as DocsV1Write.UnversionedTabbedNavigationConfig).tabs) || + Array.isArray((config as DocsV1Write.UnversionedTabbedNavigationConfig).tabsV2) + ); }