Skip to content

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

clean up

Kha Nguyen21cb65edbdb7
diff --git a/apps/web/pages/links/index.tsx b/apps/web/pages/links/index.tsx
index 19a5d098..2650ebd8 100644
--- a/apps/web/pages/links/index.tsx
+++ b/apps/web/pages/links/index.tsx
@@ -24,7 +24,6 @@ import {
useSensor,
useSensors,
} from "@dnd-kit/core";
-import { useQueryClient } from "@tanstack/react-query";
import { customCollisionDetectionAlgorithm } from "@/lib/utils";
import { snapCenterToCursor } from "@dnd-kit/modifiers";
import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon";
@@ -46,7 +45,6 @@ export default function Index() {
});
const updateLink = useUpdateLink();
- const queryClient = useQueryClient();
const mouseSensor = useSensor(MouseSensor, {
// Require the mouse to move by 10 pixels before activating
@@ -114,8 +112,6 @@ export default function Index() {
onSettled: (_, error) => {
toast.dismiss(load);
if (error) {
- // If there's an error, invalidate queries to restore the original state
- queryClient.invalidateQueries({ queryKey: ["dashboardData"] });
toast.error(error.message);
} else {
toast.success(t("updated"));
diff --git a/apps/web/pages/links/pinned.tsx b/apps/web/pages/links/pinned.tsx
index 66d22372..cd21efb4 100644
--- a/apps/web/pages/links/pinned.tsx
+++ b/apps/web/pages/links/pinned.tsx
@@ -22,7 +22,6 @@ import {
useSensors,
} from "@dnd-kit/core";
import toast from "react-hot-toast";
-import { useQueryClient } from "@tanstack/react-query";
import { snapCenterToCursor } from "@dnd-kit/modifiers";
import { customCollisionDetectionAlgorithm } from "@/lib/utils";
import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon";
@@ -58,7 +57,6 @@ export default function PinnedLinks() {
const sensors = useSensors(mouseSensor, touchSensor);
- const queryClient = useQueryClient();
const updateLink = useUpdateLink();
const [activeLink, setActiveLink] =
useState<LinkIncludingShortenedCollectionAndTags | null>(null);
@@ -106,8 +104,6 @@ export default function PinnedLinks() {
onSettled: (_, error) => {
toast.dismiss(load);
if (error) {
- // If there's an error, invalidate queries to restore the original state
- queryClient.invalidateQueries({ queryKey: ["dashboardData"] });
toast.error(error.message);
} else {
toast.success(t("updated"));
diff --git a/apps/web/pages/search.tsx b/apps/web/pages/search.tsx
index ad865877..dd6217fb 100644
--- a/apps/web/pages/search.tsx
+++ b/apps/web/pages/search.tsx
@@ -22,7 +22,6 @@ import {
useSensor,
useSensors,
} from "@dnd-kit/core";
-import { useQueryClient } from "@tanstack/react-query";
import toast from "react-hot-toast";
import { customCollisionDetectionAlgorithm } from "@/lib/utils";
import { snapCenterToCursor } from "@dnd-kit/modifiers";
@@ -46,7 +45,6 @@ export default function Search() {
useState<LinkIncludingShortenedCollectionAndTags | null>(null);
const updateLink = useUpdateLink();
- const queryClient = useQueryClient();
const mouseSensor = useSensor(MouseSensor, {
// Require the mouse to move by 10 pixels before activating
@@ -114,8 +112,6 @@ export default function Search() {
onSettled: (_, error) => {
toast.dismiss(load);
if (error) {
- // If there's an error, invalidate queries to restore the original state
- queryClient.invalidateQueries({ queryKey: ["dashboardData"] });
toast.error(error.message);
} else {
toast.success(t("updated"));