diff --git a/src/renderer/src/lib/query-client.ts b/src/renderer/src/lib/query-client.ts index 0b18164027..fc454398f0 100644 --- a/src/renderer/src/lib/query-client.ts +++ b/src/renderer/src/lib/query-client.ts @@ -41,6 +41,8 @@ export const persistConfig: OmitKeyof< "queryClient" > = { persister: localStoragePersister, + // 7 day + maxAge: 7 * 24 * 60 * 60 * 1000, dehydrateOptions: { shouldDehydrateQuery: (query) => { if (!query.meta?.persist) return false diff --git a/src/renderer/src/modules/discover/form.tsx b/src/renderer/src/modules/discover/form.tsx index 15af7d5f36..067a158395 100644 --- a/src/renderer/src/modules/discover/form.tsx +++ b/src/renderer/src/modules/discover/form.tsx @@ -128,7 +128,11 @@ export function DiscoverForm({ type }: { type: string }) { )} />
- + {info[type].showModal ? "Preview" : "Search"}
diff --git a/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx b/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx index cbacc9a354..c60a55b05d 100644 --- a/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx +++ b/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx @@ -8,6 +8,7 @@ import { DiscoverForm } from "@renderer/modules/discover/form" import { DiscoverImport } from "@renderer/modules/discover/import" import { Recommendations } from "@renderer/modules/discover/recommendations" import { DiscoverRSS3 } from "@renderer/modules/discover/rss3-form" +import { createElement } from "react" export function Component() { const tabs = [ @@ -55,15 +56,11 @@ export function Component() { {tabs.map((tab) => ( - {tab.value === "import" ? ( - - ) : tab.value === "rss3" ? - ( - - ) : - ( - - )} + {TabComponent[tab.value] ? ( + createElement(TabComponent[tab.value]) + ) : ( + + )} ))} @@ -71,3 +68,8 @@ export function Component() { ) } + +const TabComponent = { + import: DiscoverImport, + rss3: DiscoverRSS3, +}