aboutsummaryrefslogtreecommitdiffstats
path: root/apps/browser-extension/src/components/ListsSelector.tsx
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-01 12:29:54 +0000
committerGitHub <noreply@github.com>2026-02-01 12:29:54 +0000
commit65f6e83f11c82b0ec762e11f3392a80e614ee69a (patch)
tree945d8d73122f07fe6a77c2bd3ac9db566939ba3b /apps/browser-extension/src/components/ListsSelector.tsx
parente516a525bca6f319a2f003e9677624e968b277bf (diff)
downloadkarakeep-65f6e83f11c82b0ec762e11f3392a80e614ee69a.tar.zst
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
Diffstat (limited to 'apps/browser-extension/src/components/ListsSelector.tsx')
-rw-r--r--apps/browser-extension/src/components/ListsSelector.tsx12
1 files changed, 8 insertions, 4 deletions
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();