Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor improvement

daniel31x13cbf93dcf061a
diff --git a/components/LinkViews/LinkComponents/LinkCard.tsx b/components/LinkViews/LinkComponents/LinkCard.tsx
index d92a6877..43331b1a 100644
--- a/components/LinkViews/LinkComponents/LinkCard.tsx
+++ b/components/LinkViews/LinkComponents/LinkCard.tsx
@@ -113,8 +113,7 @@ export default function LinkCard({ link, columns, editMode }: Props) {
const permissions = usePermissions(collection?.id as number);
const router = useRouter();
-
- let isPublic = router.pathname.startsWith("/public") ? true : undefined;
+ const isPublicRoute = router.pathname.startsWith("/public") ? true : false;
useEffect(() => {
let interval: NodeJS.Timeout | null = null;
@@ -125,7 +124,10 @@ export default function LinkCard({ link, columns, editMode }: Props) {
link.preview !== "unavailable"
) {
interval = setInterval(async () => {
- getLink.mutateAsync({ id: link.id as number, isPublicRoute: isPublic });
+ getLink.mutateAsync({
+ id: link.id as number,
+ isPublicRoute: isPublicRoute,
+ });
}, 5000);
}
@@ -146,8 +148,6 @@ export default function LinkCard({ link, columns, editMode }: Props) {
editMode &&
(permissions === true || permissions?.canCreate || permissions?.canDelete);
- const isPublicRoute = router.pathname.startsWith("/public") ? true : false;
-
return (
<div
ref={ref}
@@ -220,7 +220,7 @@ export default function LinkCard({ link, columns, editMode }: Props) {
<hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" />
<div className="flex justify-between items-center text-xs text-neutral px-3 pb-1 gap-2">
- {show.collection && (
+ {show.collection && !isPublicRoute && (
<div className="cursor-pointer truncate">
<LinkCollection link={link} collection={collection} />
</div>
diff --git a/components/LinkViews/LinkComponents/LinkCollection.tsx b/components/LinkViews/LinkComponents/LinkCollection.tsx
index fdc29397..885a0159 100644
--- a/components/LinkViews/LinkComponents/LinkCollection.tsx
+++ b/components/LinkViews/LinkComponents/LinkCollection.tsx
@@ -5,6 +5,7 @@ import {
} from "@/types/global";
import { IconWeight } from "@phosphor-icons/react";
import Link from "next/link";
+import { useRouter } from "next/router";
import React from "react";
export default function LinkCollection({
@@ -14,7 +15,11 @@ export default function LinkCollection({
link: LinkIncludingShortenedCollectionAndTags;
collection: CollectionIncludingMembersAndLinkCount;
}) {
- return collection?.name ? (
+ const router = useRouter();
+
+ const isPublicRoute = router.pathname.startsWith("/public") ? true : false;
+
+ return !isPublicRoute && collection?.name ? (
<>
<Link
href={`/collections/${link.collection.id}`}
@@ -40,7 +45,5 @@ export default function LinkCollection({
<p className="truncate capitalize">{collection?.name}</p>
</Link>
</>
- ) : (
- <></>
- );
+ ) : null;
}
diff --git a/components/LinkViews/LinkComponents/LinkMasonry.tsx b/components/LinkViews/LinkComponents/LinkMasonry.tsx
index eba17792..2b501ea8 100644
--- a/components/LinkViews/LinkComponents/LinkMasonry.tsx
+++ b/components/LinkViews/LinkComponents/LinkMasonry.tsx
@@ -232,7 +232,7 @@ export default function LinkMasonry({ link, editMode, columns }: Props) {
<hr className="divider mt-2 mb-1 last:hidden border-t border-neutral-content h-[1px]" />
<div className="flex flex-wrap justify-between items-center text-xs text-neutral px-3 pb-1 w-full gap-x-2">
- {show.collection && (
+ {!isPublic && show.collection && (
<div className="cursor-pointer truncate">
<LinkCollection link={link} collection={collection} />
</div>