diff --git a/front/src/primitives/combobox.tsx b/front/src/primitives/combobox.tsx index 69942ccb..25938989 100644 --- a/front/src/primitives/combobox.tsx +++ b/front/src/primitives/combobox.tsx @@ -158,6 +158,7 @@ export const ComboBox = ({ item ? getKey(item) : `placeholder-${index}` diff --git a/front/src/primitives/combobox.web.tsx b/front/src/primitives/combobox.web.tsx index f2462ea9..897f5694 100644 --- a/front/src/primitives/combobox.web.tsx +++ b/front/src/primitives/combobox.web.tsx @@ -4,7 +4,7 @@ import ExpandMore from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fi import SearchIcon from "@material-symbols/svg-400/rounded/search-fill.svg"; import * as Popover from "@radix-ui/react-popover"; import { useMemo, useRef, useState } from "react"; -import { Platform, View } from "react-native"; +import { Platform, Pressable, View } from "react-native"; import { useInfiniteFetch } from "~/query/query"; import { cn } from "~/utils"; import type { ComboBoxProps } from "./combobox"; @@ -117,6 +117,7 @@ export const ComboBox = ({ item ? getKey(item) : `placeholder-${index}` @@ -168,14 +169,11 @@ const ComboBoxItem = ({ onSelect: () => void; }) => { return ( - +

+ {label} +

+ ); }; diff --git a/front/src/ui/admin/videos-modal/index.tsx b/front/src/ui/admin/videos-modal/index.tsx index a70b4305..224a5a1e 100644 --- a/front/src/ui/admin/videos-modal/index.tsx +++ b/front/src/ui/admin/videos-modal/index.tsx @@ -25,17 +25,15 @@ export const useEditLinks = ( compute: ({ video, entries, - guess = false, }: { video: string; entries: Omit[]; - guess?: boolean; }) => ({ body: [ { id: video, for: entries.map((x) => - guess && x.kind === "episode" + x.kind === "episode" && !x.slug ? { serie: slug, // @ts-expect-error: idk why it couldn't match x as an episode @@ -93,7 +91,11 @@ export const VideosModal = () => { layout={{ layout: "vertical", gap: 8, numColumns: 1, size: 48 }} Render={({ item }) => ( void; editLinks: ReturnType; }) => { const { t } = useTranslation(); - - const saved = item.entries.length; + const [saved] = useRecyclingState(entries.length); const guess = !saved ? uniqBy( - item.guess.episodes.map( + guesses.map( (x) => ({ kind: "episode", @@ -47,8 +55,8 @@ export const PathItem = ({ { - addTitle(item.guess.title); - await editLinks({ video: item.id, entries: [] }); + addTitle(guessTitle); + await editLinks({ video: id, entries: [] }); }} {...tooltip(t("videos-map.delete"))} /> @@ -57,9 +65,8 @@ export const PathItem = ({ icon={Check} onPress={async () => { await editLinks({ - video: item.id, + video: id, entries: guess, - guess: true, }); }} {...tooltip(t("videos-map.validate"))} @@ -71,13 +78,13 @@ export const PathItem = ({ {...tooltip(t("videos-map.no-guess"))} /> )} -

{item.path}

+

{path}

({ parser: Entry, path: ["api", "series", serieSlug, "entries"], @@ -97,9 +104,9 @@ export const PathItem = ({ getLabel={(x) => `${entryDisplayNumber(x)} - ${x.name}`} getSmallLabel={entryDisplayNumber} onValueChange={async (entries) => { - if (!entries.length) addTitle(item.guess.title); + if (!entries.length) addTitle(guessTitle); await editLinks({ - video: item.id, + video: id, entries, }); }}