diff --git a/src/renderer/src/components/follow/import.tsx b/src/renderer/src/components/follow/import.tsx index 9df58f41e..d8d8d5105 100644 --- a/src/renderer/src/components/follow/import.tsx +++ b/src/renderer/src/components/follow/import.tsx @@ -11,10 +11,11 @@ import { FormMessage, } from "@renderer/components/ui/form" import { Input } from "@renderer/components/ui/input" -import { useMutation } from "@tanstack/react-query" +import { useMutation, useQueryClient } from "@tanstack/react-query" import { Card, CardContent, CardHeader } from "@renderer/components/ui/card" import { FollowSummary } from "../feed-summary" import { apiFetch } from "@renderer/lib/queries/api-fetch" +import { cn } from "@renderer/lib/utils" type FeedResponseList = { id: string @@ -32,14 +33,17 @@ const list = [ { key: "parsedErrorItems", title: "Parsed Error Items", + className: "text-red-500", }, { key: "successfulItems", title: "Successful Items", + className: "text-green-500", }, { key: "conflictItems", title: "Conflict Items", + className: "text-yellow-500", }, ] @@ -47,6 +51,8 @@ export function FollowImport() { const form = useForm>({ resolver: zodResolver(formSchema), }) + + const queryClient = useQueryClient() const mutation = useMutation({ mutationFn: async (file: File) => { const formData = new FormData() @@ -63,6 +69,11 @@ export function FollowImport() { }) return data }, + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: ["subscriptions"], + }) + }, }) function onSubmit(values: z.infer) { @@ -122,7 +133,11 @@ export function FollowImport() { {list.map((item) => (
-
{item.title}
+
+ {item.title} +
{!mutation.data?.[item.key].length && (
No items