From 95dc3b31db55f4ddf3d1d9e9c3af20e90e119b29 Mon Sep 17 00:00:00 2001 From: Isaac Wise Date: Sat, 10 Feb 2024 16:49:32 -0600 Subject: [PATCH] Fix merge conflicts --- components/LinkViews/LinkCard.tsx | 4 +++- components/LinkViews/LinkList.tsx | 4 +++- lib/client/generateLinkHref.ts | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsx index 8ebcd528..c8e05b4b 100644 --- a/components/LinkViews/LinkCard.tsx +++ b/components/LinkViews/LinkCard.tsx @@ -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"; import usePermissions from "@/hooks/usePermissions"; type Props = { @@ -32,6 +33,7 @@ export default function LinkCard({ showCheckbox = true, }: Props) { const { collections } = useCollectionStore(); + const { account } = useAccountStore(); const { links, getLink, setSelectedLinks, selectedLinks } = useLinkStore(); @@ -106,7 +108,7 @@ export default function LinkCard({ /> } diff --git a/components/LinkViews/LinkList.tsx b/components/LinkViews/LinkList.tsx index fd5d7d3d..d9e36727 100644 --- a/components/LinkViews/LinkList.tsx +++ b/components/LinkViews/LinkList.tsx @@ -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"; import usePermissions from "@/hooks/usePermissions"; type Props = { @@ -29,6 +30,7 @@ export default function LinkCardCompact({ showCheckbox = true, }: Props) { const { collections } = useCollectionStore(); + const { account } = useAccountStore(); const { links, setSelectedLinks, selectedLinks } = useLinkStore(); const handleCheckboxClick = (link: LinkIncludingShortenedCollectionAndTags) => { @@ -81,7 +83,7 @@ export default function LinkCardCompact({ /> } diff --git a/lib/client/generateLinkHref.ts b/lib/client/generateLinkHref.ts index d122383c..5911ae7b 100644 --- a/lib/client/generateLinkHref.ts +++ b/lib/client/generateLinkHref.ts @@ -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