From ea59a4fd25d140f0138a6c3b4b57d194b896ca15 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 14 May 2024 16:30:26 +0800 Subject: [PATCH] feat: isPrivate --- src/renderer/src/components/feed-column/context-menu.tsx | 2 +- src/renderer/src/components/follow/dialog.tsx | 7 ++++--- src/renderer/src/lib/types.ts | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/feed-column/context-menu.tsx b/src/renderer/src/components/feed-column/context-menu.tsx index 0bcd8ca7be..23f47a332d 100644 --- a/src/renderer/src/components/feed-column/context-menu.tsx +++ b/src/renderer/src/components/feed-column/context-menu.tsx @@ -55,7 +55,7 @@ export function FeedContextMenu({ url: variables.feeds.url, view: feed.view, category: variables.category, - // private: variables.private, + isPrivate: variables.isPrivate, }, }) queryClient.invalidateQueries({ diff --git a/src/renderer/src/components/follow/dialog.tsx b/src/renderer/src/components/follow/dialog.tsx index 0da2df49a8..1ceef28922 100644 --- a/src/renderer/src/components/follow/dialog.tsx +++ b/src/renderer/src/components/follow/dialog.tsx @@ -35,7 +35,7 @@ import { SubscriptionResponse } from "@renderer/lib/types" const formSchema = z.object({ view: z.string(), category: z.string().optional(), - private: z.boolean().optional(), + isPrivate: z.boolean().optional(), }) export function FollowDialog({ @@ -62,6 +62,7 @@ export function FollowDialog({ defaultValues: { view: isSubscribed ? feed.view + "" : "0", category: isSubscribed ? feed.category : undefined, + isPrivate: isSubscribed ? feed.isPrivate : false, }, }) @@ -74,7 +75,7 @@ export function FollowDialog({ url: feed.feeds.url, view: parseInt(values.view), category: values.category, - private: values.private, + isPrivate: values.isPrivate, }, }), onSuccess: (_, variables) => { @@ -149,7 +150,7 @@ export function FollowDialog({ /> (
diff --git a/src/renderer/src/lib/types.ts b/src/renderer/src/lib/types.ts index fcc829e8e7..45f4c9db74 100644 --- a/src/renderer/src/lib/types.ts +++ b/src/renderer/src/lib/types.ts @@ -26,6 +26,7 @@ export type SubscriptionResponse = { view: number category?: string title?: string + isPrivate?: boolean unread?: number feeds: FeedResponse }[]