diff --git a/src/renderer/src/hono.ts b/src/renderer/src/hono.ts index 0b908cc5b6..5e5cc3c1c9 100644 --- a/src/renderer/src/hono.ts +++ b/src/renderer/src/hono.ts @@ -2965,7 +2965,6 @@ declare const _routes: hono_hono_base.HonoBase}`]: { + input: Partial; + output: any; + outputFormat: string; + status: hono_utils_http_status.StatusCode; + }; + }; "/entries": { $post: { input: { @@ -3110,8 +3116,8 @@ declare const _routes: hono_hono_base.HonoBase = { search: { @@ -43,10 +45,13 @@ const info: Record< }, rss: { label: "RSS URL", + prefix: "https://", + showModal: true, }, rsshub: { label: "RSSHub Route", prefix: "rsshub://", + showModal: true, }, } @@ -63,7 +68,6 @@ export function DiscoverForm({ type }: { type: string }) { const { data } = await apiClient.discover.$post({ json: { keyword, - type: type === "rss" ? "rss" : "auto", }, }) @@ -71,8 +75,25 @@ export function DiscoverForm({ type }: { type: string }) { }, }) + const { present, dismissAll } = useModalStack() + function onSubmit(values: z.infer) { - mutation.mutate(values.keyword) + if (info[type].showModal) { + const defaultView = getSidebarActiveView() as FeedViewType + present({ + title: "Add follow", + content: () => ( + + ), + }) + } else { + mutation.mutate(values.keyword) + } } const keyword = form.watch("keyword") @@ -86,8 +107,6 @@ export function DiscoverForm({ type }: { type: string }) { } }, [keyword]) - const { present } = useModalStack() - return ( <>
@@ -110,7 +129,7 @@ export function DiscoverForm({ type }: { type: string }) { />
- Search + {info[type].showModal ? "Preview" : "Search"}
diff --git a/src/renderer/src/modules/discover/import.tsx b/src/renderer/src/modules/discover/import.tsx index 7199e455bd..22e2f1a2bc 100644 --- a/src/renderer/src/modules/discover/import.tsx +++ b/src/renderer/src/modules/discover/import.tsx @@ -110,9 +110,11 @@ export function DiscoverImport() { )} /> - - Import - +
+ + Import + +
{mutation.isSuccess && (