A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: preserve selected section in link preview in query params
MohamedBassem6dde9f209060
diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsxindex a0a6f580..53559aa0 100644--- a/apps/web/components/dashboard/preview/LinkContentSection.tsx+++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx@@ -1,4 +1,3 @@-import { useState } from "react";import Image from "next/image";import Link from "next/link";import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";@@ -26,6 +25,7 @@ import {ExpandIcon,Video,} from "lucide-react";+import { useQueryState } from "nuqs";import { ErrorBoundary } from "react-error-boundary";import {@@ -108,7 +108,9 @@ export default function LinkContentSection({const availableRenderers = contentRendererRegistry.getRenderers(bookmark);const defaultSection =availableRenderers.length > 0 ? availableRenderers[0].id : "cached";- const [section, setSection] = useState<string>(defaultSection);+ const [section, setSection] = useQueryState("section", {+ defaultValue: defaultSection,+ });if (bookmark.content.type != BookmarkTypes.LINK) {throw new Error("Invalid content type");