Skip to content

Commit

Permalink
Rename meta -> view
Browse files Browse the repository at this point in the history
This is actually all it is now.
  • Loading branch information
gaearon committed Oct 21, 2024
1 parent 0a7640d commit 5c4ff8b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/lib/api/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ type ResolvedPostRecord = {
type: 'record'
record: ComAtprotoRepoStrongRef.Main
kind: 'post'
meta: AppBskyFeedDefs.PostView
view: AppBskyFeedDefs.PostView
}

type ResolvedFeedRecord = {
type: 'record'
record: ComAtprotoRepoStrongRef.Main
kind: 'feed'
meta: AppBskyFeedDefs.GeneratorView
view: AppBskyFeedDefs.GeneratorView
}

type ResolvedListRecord = {
type: 'record'
record: ComAtprotoRepoStrongRef.Main
kind: 'list'
meta: AppBskyGraphDefs.ListView
view: AppBskyGraphDefs.ListView
}

type ResolvedStarterPackRecord = {
type: 'record'
record: ComAtprotoRepoStrongRef.Main
kind: 'starter-pack'
meta: AppBskyGraphDefs.StarterPackView
view: AppBskyGraphDefs.StarterPackView
}

export type ResolvedLink =
Expand Down Expand Up @@ -99,7 +99,7 @@ export async function resolveLink(
uri: post.uri,
},
kind: 'post',
meta: post,
view: post,
}
}
if (isBskyCustomFeedUrl(uri)) {
Expand All @@ -115,7 +115,7 @@ export async function resolveLink(
cid: res.data.view.cid,
},
kind: 'feed',
meta: res.data.view,
view: res.data.view,
}
}
if (isBskyListUrl(uri)) {
Expand All @@ -131,7 +131,7 @@ export async function resolveLink(
cid: res.data.list.cid,
},
kind: 'list',
meta: res.data.list,
view: res.data.list,
}
}
if (isBskyStartUrl(uri) || isBskyStarterPackUrl(uri)) {
Expand All @@ -151,7 +151,7 @@ export async function resolveLink(
cid: res.data.starterPack.cid,
},
kind: 'starter-pack',
meta: res.data.starterPack,
view: res.data.starterPack,
}
}
return resolveExternal(agent, uri)
Expand Down
2 changes: 1 addition & 1 deletion src/state/shell/composer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
cid: opts.quote.cid,
uri: opts.quote.uri,
},
meta: opts.quote,
view: opts.quote,
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/view/com/composer/ExternalEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ function getExternalLinkTitle(link: ResolvedLink): string | undefined {
// These are currently treated as external.
// TODO: Display them as embeds instead.
case 'feed':
return link.meta.displayName
return link.view.displayName
case 'list':
return link.meta.name
return link.view.name
case 'starter-pack':
const record = link.meta.record
const record = link.view.record
return AppBskyGraphStarterpack.isRecord(record)
? record.name
: 'Starter Pack'
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/util/post-embeds/QuoteEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function LazyQuoteEmbed({uri}: {uri: string}) {
if (!data || data.type !== 'record' || data.kind !== 'post') {
return null
}
return <QuoteEmbed quote={data.meta} />
return <QuoteEmbed quote={data.view} />
}

function viewRecordToPostView(
Expand Down

0 comments on commit 5c4ff8b

Please sign in to comment.