suggestions (#7382)
* suggestions * Revert unneeded changes --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
committed by
Eric Bailey
parent
09cb5aa53b
commit
31ae18591c
@@ -568,3 +568,12 @@ export function parseTenorGif(urlp: URL):
|
||||
dimensions,
|
||||
}
|
||||
}
|
||||
|
||||
export function isTenorGifUri(url: URL | string) {
|
||||
try {
|
||||
return parseTenorGif(typeof url === 'string' ? new URL(url) : url).success
|
||||
} catch {
|
||||
// Invalid URL
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,11 +111,7 @@ export function MessageInputEmbed({
|
||||
)
|
||||
|
||||
const {rt, record} = useMemo(() => {
|
||||
if (
|
||||
post &&
|
||||
AppBskyFeedPost.isRecord(post.record) &&
|
||||
AppBskyFeedPost.validateRecord(post.record).success
|
||||
) {
|
||||
if (post && AppBskyFeedPost.isValidRecord(post.record)) {
|
||||
return {
|
||||
rt: new RichTextAPI({
|
||||
text: post.record.text,
|
||||
|
||||
@@ -16,9 +16,9 @@ export * as profile from '#/types/atproto/profile'
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export function fastIsType<R>(
|
||||
export function fastIsType<R extends {$type?: string}>(
|
||||
record: unknown,
|
||||
identity: <V>(v: V) => boolean,
|
||||
identity: <V>(v: V) => v is V & {$type: NonNullable<R['$type']>},
|
||||
): record is R {
|
||||
return identity(record)
|
||||
}
|
||||
|
||||
@@ -42,10 +42,8 @@ export function anyToBasic(
|
||||
associated: view.associated,
|
||||
viewer: view.viewer,
|
||||
labels: view.labels,
|
||||
// @ts-expect-error `createdAt` doesn't exist on chat view
|
||||
createdAt: ChatBskyActorDefs.isProfileViewBasic(view)
|
||||
? undefined
|
||||
: view.createdAt,
|
||||
// `createdAt` doesn't exist in ChatBskyActorDefs.ProfileViewBasic
|
||||
createdAt: 'createdAt' in view ? view.createdAt : undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user