Skip to content

Commit 27c48f2

Browse files
committed
fix: update HeaderNav links to handle undefined cloud plans
- Modified the navigation links in HeaderNavStack and HeaderNavStackMobile to include a condition that allows for rendering the default URL when the cloud plan is undefined, improving user experience and navigation reliability.
1 parent 9c6bc1f commit 27c48f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Layout/HeaderNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function HeaderNavStack(props: {
6767
selected={selectedItem === "tidbcloud"}
6868
label={t("navbar.cloud")}
6969
to={
70-
cloudPlan === "dedicated"
70+
cloudPlan === "dedicated" || !cloudPlan
7171
? `/tidbcloud`
7272
: `/tidbcloud/${cloudPlan}?${CLOUD_MODE_KEY}=${cloudPlan}`
7373
}
@@ -247,7 +247,7 @@ export function HeaderNavStackMobile(props: { buildType?: BuildType }) {
247247
<LinkComponent
248248
isI18n
249249
to={
250-
cloudPlan === "dedicated"
250+
cloudPlan === "dedicated" || !cloudPlan
251251
? `/tidbcloud`
252252
: `/tidbcloud/${cloudPlan}?${CLOUD_MODE_KEY}=${cloudPlan}`
253253
}

0 commit comments

Comments
 (0)