mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-05 03:52:51 +01:00
fix(tv): type lastSegment as string for typed-routes index check
This commit is contained in:
@@ -50,7 +50,9 @@ function TVTabLayout() {
|
||||
const router = useRouter();
|
||||
|
||||
const currentTab = segments.find(isTabRoute);
|
||||
const lastSegment = segments[segments.length - 1] ?? "";
|
||||
// Widened to string: typed routes omit "index" segments, but they can still
|
||||
// appear at runtime, so keep the guard without tripping TS2367.
|
||||
const lastSegment: string = segments[segments.length - 1] ?? "";
|
||||
const atTabRoot = isTabRoute(lastSegment) || lastSegment === "index";
|
||||
|
||||
const tabs: TVNavBarTab[] = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user