Fixed builds failing
This commit is contained in:
parent
c78aa2da0d
commit
e0705ece4f
|
@ -16,6 +16,7 @@ import Link from "next/link";
|
|||
import LinkIcon from "./LinkComponents/LinkIcon";
|
||||
import useOnScreen from "@/hooks/useOnScreen";
|
||||
import { generateLinkHref } from "@/lib/client/generateLinkHref";
|
||||
import useAccountStore from "@/store/account";
|
||||
|
||||
type Props = {
|
||||
link: LinkIncludingShortenedCollectionAndTags;
|
||||
|
@ -29,6 +30,7 @@ export default function LinkGrid({
|
|||
flipDropdown,
|
||||
}: Props) {
|
||||
const { collections } = useCollectionStore();
|
||||
const { account } = useAccountStore();
|
||||
|
||||
const { links, getLink } = useLinkStore();
|
||||
|
||||
|
@ -86,7 +88,7 @@ export default function LinkGrid({
|
|||
className="border border-solid border-neutral-content bg-base-200 shadow-md hover:shadow-none duration-100 rounded-2xl relative"
|
||||
>
|
||||
<Link
|
||||
href={generateLinkHref(link)}
|
||||
href={generateLinkHref(link, account)}
|
||||
target="_blank"
|
||||
className="rounded-2xl cursor-pointer"
|
||||
>
|
||||
|
|
|
@ -13,6 +13,7 @@ import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon";
|
|||
import Link from "next/link";
|
||||
import { isPWA } from "@/lib/client/utils";
|
||||
import { generateLinkHref } from "@/lib/client/generateLinkHref";
|
||||
import useAccountStore from "@/store/account";
|
||||
|
||||
type Props = {
|
||||
link: LinkIncludingShortenedCollectionAndTags;
|
||||
|
@ -26,6 +27,7 @@ export default function LinkCardCompact({
|
|||
flipDropdown,
|
||||
}: Props) {
|
||||
const { collections } = useCollectionStore();
|
||||
const { account } = useAccountStore();
|
||||
const { links } = useLinkStore();
|
||||
|
||||
let shortendURL;
|
||||
|
@ -60,7 +62,7 @@ export default function LinkCardCompact({
|
|||
} duration-200 rounded-lg`}
|
||||
>
|
||||
<Link
|
||||
href={generateLinkHref(link)}
|
||||
href={generateLinkHref(link, account)}
|
||||
target="_blank"
|
||||
className="flex items-start cursor-pointer"
|
||||
>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import useAccountStore from "@/store/account";
|
||||
import { ArchivedFormat, LinkIncludingShortenedCollectionAndTags } from "@/types/global";
|
||||
import { AccountSettings, ArchivedFormat, LinkIncludingShortenedCollectionAndTags } from "@/types/global";
|
||||
import { LinksRouteTo } from "@prisma/client";
|
||||
import { pdfAvailable, readabilityAvailable, screenshotAvailable } from "../shared/getArchiveValidity";
|
||||
|
||||
export const generateLinkHref = (link: LinkIncludingShortenedCollectionAndTags): string => {
|
||||
const { account } = useAccountStore();
|
||||
export const generateLinkHref = (link: LinkIncludingShortenedCollectionAndTags, account: AccountSettings): string => {
|
||||
|
||||
// Return the links href based on the account's preference
|
||||
// If the user's preference is not available, return the original link
|
||||
|
|
Ŝarĝante…
Reference in New Issue