Bookmarks only while browsing

Disabled bookmarks when there is nothing in the search bar.
This commit is contained in:
Ivan Evans 2024-04-30 09:53:31 -06:00
parent 2b7a054d5f
commit 9a8ecf2e88
2 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export const SearchBarInput = forwardRef<HTMLInputElement, SearchBarProps>(
const [focused, setFocused] = useState(false);
function setSearch(value: string) {
props.onChange(value, false);
props.onChange(value, true);
}
return (

View File

@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
import { mediaItemToId } from "@/backend/metadata/tmdb";
import { DotList } from "@/components/text/DotList";
import { Flare } from "@/components/utils/Flare";
import { useSearchQuery } from "@/hooks/useSearchQuery";
import { MediaItem } from "@/utils/mediaTypes";
import { MediaBookmarkButton } from "./MediaBookmark";
@ -57,6 +58,8 @@ function MediaCardContent({
const dotListContent = [t(`media.types.${media.type}`)];
const [searchQuery] = useSearchQuery();
if (media.year) {
dotListContent.push(media.year.toFixed());
}
@ -142,7 +145,7 @@ function MediaCardContent({
</>
) : null}
{canLink ? (
{canLink && searchQuery.length > 0 ? (
<div className="absolute" onClick={(e) => e.preventDefault()}>
<MediaBookmarkButton media={media} />
</div>