From 246a7cd0851cd9866eb614720c3cc414e7e2a1b7 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 8 Oct 2024 14:58:10 +0900 Subject: [PATCH] Rename meta -> view This is actually all it is now. --- src/lib/api/resolve.ts | 16 ++++++++-------- src/state/shell/composer/index.tsx | 2 +- src/view/com/composer/ExternalEmbed.tsx | 6 +++--- src/view/com/util/post-embeds/QuoteEmbed.tsx | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/api/resolve.ts b/src/lib/api/resolve.ts index a1c93f708b..b305e4d463 100644 --- a/src/lib/api/resolve.ts +++ b/src/lib/api/resolve.ts @@ -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 = @@ -99,7 +99,7 @@ export async function resolveLink( uri: post.uri, }, kind: 'post', - meta: post, + view: post, } } if (isBskyCustomFeedUrl(uri)) { @@ -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)) { @@ -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)) { @@ -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) diff --git a/src/state/shell/composer/index.tsx b/src/state/shell/composer/index.tsx index dc9a7d880d..9cac64426d 100644 --- a/src/state/shell/composer/index.tsx +++ b/src/state/shell/composer/index.tsx @@ -66,7 +66,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { cid: opts.quote.cid, uri: opts.quote.uri, }, - meta: opts.quote, + view: opts.quote, }) } } diff --git a/src/view/com/composer/ExternalEmbed.tsx b/src/view/com/composer/ExternalEmbed.tsx index c8336fd855..1f1feaf919 100644 --- a/src/view/com/composer/ExternalEmbed.tsx +++ b/src/view/com/composer/ExternalEmbed.tsx @@ -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' diff --git a/src/view/com/util/post-embeds/QuoteEmbed.tsx b/src/view/com/util/post-embeds/QuoteEmbed.tsx index 49cfb21509..2844d562b7 100644 --- a/src/view/com/util/post-embeds/QuoteEmbed.tsx +++ b/src/view/com/util/post-embeds/QuoteEmbed.tsx @@ -284,7 +284,7 @@ export function LazyQuoteEmbed({uri}: {uri: string}) { if (!data || data.type !== 'record' || data.kind !== 'post') { return null } - return + return } function viewRecordToPostView(