⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
Fixed builds failing
Isaac Wisee0705ece4f97
diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsxindex 20694b34..fc3060d3 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";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">diff --git a/components/LinkViews/LinkList.tsx b/components/LinkViews/LinkList.tsxindex 0ab489af..f4e45000 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";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">diff --git a/lib/client/generateLinkHref.ts b/lib/client/generateLinkHref.tsindex 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