mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
fix: BaseItemDto/BaseItemPerson routing bug (#1030)
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { useActionSheet } from "@expo/react-native-action-sheet";
|
||||
import type {
|
||||
BaseItemDto,
|
||||
BaseItemPerson,
|
||||
} from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { useRouter, useSegments } from "expo-router";
|
||||
import { type PropsWithChildren, useCallback } from "react";
|
||||
import { TouchableOpacity, type TouchableOpacityProps } from "react-native";
|
||||
@@ -14,10 +11,7 @@ interface Props extends TouchableOpacityProps {
|
||||
isOffline?: boolean;
|
||||
}
|
||||
|
||||
export const itemRouter = (
|
||||
item: BaseItemDto | BaseItemPerson,
|
||||
from: string,
|
||||
) => {
|
||||
export const itemRouter = (item: BaseItemDto, from: string) => {
|
||||
if ("CollectionType" in item && item.CollectionType === "livetv") {
|
||||
return `/(auth)/(tabs)/${from}/livetv`;
|
||||
}
|
||||
@@ -26,8 +20,8 @@ export const itemRouter = (
|
||||
return `/(auth)/(tabs)/${from}/series/${item.Id}`;
|
||||
}
|
||||
|
||||
if (item.Type === "Person" || item.Type === "Actor") {
|
||||
return `/(auth)/(tabs)/${from}/actors/${item.Id}`;
|
||||
if (item.Type === "Person") {
|
||||
return `/(auth)/(tabs)/${from}/persons/${item.Id}`;
|
||||
}
|
||||
|
||||
if (item.Type === "BoxSet") {
|
||||
|
||||
Reference in New Issue
Block a user