diff --git a/src/lib/api/resolve.ts b/src/lib/api/resolve.ts index 1115a4fb09..6fc57493fa 100644 --- a/src/lib/api/resolve.ts +++ b/src/lib/api/resolve.ts @@ -64,7 +64,7 @@ export type ResolvedLink = | ResolvedPostRecord | ResolvedOtherRecord -class EmbeddingDisabledError extends Error { +export class EmbeddingDisabledError extends Error { constructor() { super('Embedding is disabled for this record') } diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 87f72ce425..55c2d81ab3 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -48,6 +48,7 @@ import {useLingui} from '@lingui/react' import {useQueryClient} from '@tanstack/react-query' import * as apilib from '#/lib/api/index' +import {EmbeddingDisabledError} from '#/lib/api/resolve' import {until} from '#/lib/async/until' import {MAX_GRAPHEME_LENGTH} from '#/lib/constants' import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED' @@ -420,6 +421,8 @@ export const ComposePost = ({ err = _( msg`We're sorry! The post you are replying to has been deleted.`, ) + } else if (e instanceof EmbeddingDisabledError) { + err = _(msg`This post's author has disabled quote posts.`) } setError(err) setIsProcessing(false)