From 65f6e83f11c82b0ec762e11f3392a80e614ee69a Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 1 Feb 2026 12:29:54 +0000
Subject: refactor: migrate trpc to the new react query integration mode
 (#2438)

* refactor: migrate trpc to the new react query integration mode

* more fixes

* more migrations

* upgrade trpc client
---
 apps/browser-extension/src/components/ListsSelector.tsx | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'apps/browser-extension/src/components/ListsSelector.tsx')

diff --git a/apps/browser-extension/src/components/ListsSelector.tsx b/apps/browser-extension/src/components/ListsSelector.tsx
index 86c151d1..b27e866a 100644
--- a/apps/browser-extension/src/components/ListsSelector.tsx
+++ b/apps/browser-extension/src/components/ListsSelector.tsx
@@ -1,4 +1,5 @@
 import * as React from "react";
+import { useQuery } from "@tanstack/react-query";
 import { useSet } from "@uidotdev/usehooks";
 import { Check, ChevronsUpDown } from "lucide-react";
 
@@ -9,7 +10,7 @@ import {
 } from "@karakeep/shared-react/hooks/lists";
 
 import { cn } from "../utils/css";
-import { api } from "../utils/trpc";
+import { useTRPC } from "../utils/trpc";
 import { Button } from "./ui/button";
 import {
   Command,
@@ -23,14 +24,17 @@ import { DynamicPopoverContent } from "./ui/dynamic-popover";
 import { Popover, PopoverTrigger } from "./ui/popover";
 
 export function ListsSelector({ bookmarkId }: { bookmarkId: string }) {
+  const api = useTRPC();
   const currentlyUpdating = useSet<string>();
   const [open, setOpen] = React.useState(false);
 
   const { mutate: addToList } = useAddBookmarkToList();
   const { mutate: removeFromList } = useRemoveBookmarkFromList();
-  const { data: existingLists } = api.lists.getListsOfBookmark.useQuery({
-    bookmarkId,
-  });
+  const { data: existingLists } = useQuery(
+    api.lists.getListsOfBookmark.queryOptions({
+      bookmarkId,
+    }),
+  );
 
   const { data: allLists } = useBookmarkLists();
 
-- 
cgit v1.2.3-70-g09d2

