about summary refs log tree commit diff
path: root/src/state/queries/feed.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-13 15:53:57 -0600
committerGitHub <noreply@github.com>2023-11-13 13:53:57 -0800
commit06eb8b9a4caf3b4163451c538fa327a880c3a2d2 (patch)
tree07d7f2a068920640b4c536b7020146556086dbec /src/state/queries/feed.ts
parenta01463788d5e38ffca81fd0d50886838b7a3baba (diff)
downloadvoidsky-06eb8b9a4caf3b4163451c538fa327a880c3a2d2.tar.zst
Factor our feed source model (#1887)
* Refactor first onboarding step

* Replace old FeedSourceCard

* Clean up CustomFeedEmbed

* Remove discover feeds model

* Refactor ProfileFeed screen

* Remove useCustomFeed

* Delete some unused models

* Rip out more prefs

* Factor out treeView from thread comp

* Improve last commit
Diffstat (limited to 'src/state/queries/feed.ts')
-rw-r--r--src/state/queries/feed.ts68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts
index dde37315d..4ec82c6fb 100644
--- a/src/state/queries/feed.ts
+++ b/src/state/queries/feed.ts
@@ -21,39 +21,41 @@ import {sanitizeHandle} from '#/lib/strings/handles'
 import {useSession} from '#/state/session'
 import {usePreferencesQuery} from '#/state/queries/preferences'
 
-export type FeedSourceInfo =
-  | {
-      type: 'feed'
-      uri: string
-      route: {
-        href: string
-        name: string
-        params: Record<string, string>
-      }
-      cid: string
-      avatar: string | undefined
-      displayName: string
-      description: RichText
-      creatorDid: string
-      creatorHandle: string
-      likeCount: number | undefined
-      likeUri: string | undefined
-    }
-  | {
-      type: 'list'
-      uri: string
-      route: {
-        href: string
-        name: string
-        params: Record<string, string>
-      }
-      cid: string
-      avatar: string | undefined
-      displayName: string
-      description: RichText
-      creatorDid: string
-      creatorHandle: string
-    }
+export type FeedSourceFeedInfo = {
+  type: 'feed'
+  uri: string
+  route: {
+    href: string
+    name: string
+    params: Record<string, string>
+  }
+  cid: string
+  avatar: string | undefined
+  displayName: string
+  description: RichText
+  creatorDid: string
+  creatorHandle: string
+  likeCount: number | undefined
+  likeUri: string | undefined
+}
+
+export type FeedSourceListInfo = {
+  type: 'list'
+  uri: string
+  route: {
+    href: string
+    name: string
+    params: Record<string, string>
+  }
+  cid: string
+  avatar: string | undefined
+  displayName: string
+  description: RichText
+  creatorDid: string
+  creatorHandle: string
+}
+
+export type FeedSourceInfo = FeedSourceFeedInfo | FeedSourceListInfo
 
 export const feedSourceInfoQueryKey = ({uri}: {uri: string}) => [
   'getFeedSourceInfo',