This commit is contained in:
Isaac Wise 2024-07-22 17:50:24 -05:00
parent 614653bf29
commit 7d43ed52a4
No known key found for this signature in database
GPG Key ID: A02A33A7E2427136
4 changed files with 29 additions and 24 deletions

View File

@ -63,7 +63,8 @@ async function processBookmarks(
) as Element;
if (collectionName) {
const collectionNameContent = (collectionName.children[0] as TextNode)?.content;
const collectionNameContent = (collectionName.children[0] as TextNode)
?.content;
if (collectionNameContent) {
collectionId = await createCollection(
userId,
@ -274,4 +275,3 @@ function processNodes(nodes: Node[]) {
nodes.forEach(findAndProcessDL);
return nodes;
}

View File

@ -9,7 +9,8 @@ const getPublicCollectionData = async (
) => {
const res = await fetch("/api/v1/public/collections/" + collectionId);
if (res.status === 400) return { response: "Collection not found.", status: 400 };
if (res.status === 400)
return { response: "Collection not found.", status: 400 };
const data = await res.json();

View File

@ -68,15 +68,18 @@ export default function PublicCollections() {
searchByTags: searchFilter.tags,
});
const [collection, setCollection] = useState<CollectionIncludingMembersAndLinkCount>();
const [collection, setCollection] =
useState<CollectionIncludingMembersAndLinkCount>();
useEffect(() => {
if (router.query.id) {
getPublicCollectionData(Number(router.query.id), setCollection).then((res) => {
getPublicCollectionData(Number(router.query.id), setCollection).then(
(res) => {
if (res.status === 400) {
router.push("/dashboard");
}
})
}
);
}
}, [collections]);
@ -111,7 +114,8 @@ export default function PublicCollections() {
<div
className="h-96"
style={{
backgroundImage: `linear-gradient(${collection?.color}30 10%, ${settings.theme === "dark" ? "#262626" : "#f3f4f6"
backgroundImage: `linear-gradient(${collection?.color}30 10%, ${
settings.theme === "dark" ? "#262626" : "#f3f4f6"
} 13rem, ${settings.theme === "dark" ? "#171717" : "#ffffff"} 100%)`,
}}
>