From e663994c9b63b850331f6508d1dd86562e16a8a1 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:24:24 -0700 Subject: [PATCH] Allow tab name 0 --- src/components/tab.jsx | 2 +- src/pages/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tab.jsx b/src/components/tab.jsx index 19501313b..e47f21af7 100644 --- a/src/components/tab.jsx +++ b/src/components/tab.jsx @@ -4,7 +4,7 @@ import classNames from "classnames"; import { TabContext } from "utils/contexts/tab"; export function slugify(tabName) { - return tabName ? encodeURIComponent(tabName.toString().replace(/\s+/g, '-').toLowerCase()) : '' + return tabName !== undefined ? encodeURIComponent(tabName.toString().replace(/\s+/g, '-').toLowerCase()) : '' } export default function Tab({ tab }) { diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 3a0a71367..739c40703 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -239,7 +239,7 @@ function Home({ initialSettings }) { const tabs = useMemo( () => [ ...new Set( Object.keys(settings.layout ?? {}).map( - (groupName) => settings.layout[groupName]?.tab + (groupName) => settings.layout[groupName]?.tab?.toString() ).filter(group => group) ) ], [settings.layout]);