render message with no content as empty message
This commit is contained in:
parent
47ac3cb762
commit
1d58c7a68d
3 changed files with 19 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import { HTMLReactParserOptions } from 'html-react-parser';
|
|||
import { Opts } from 'linkifyjs';
|
||||
import { config } from 'folds';
|
||||
import {
|
||||
EmptyContent,
|
||||
MAudio,
|
||||
MEmote,
|
||||
MFile,
|
||||
|
|
@ -164,6 +165,10 @@ export function RenderMessageContent({
|
|||
return <MLocation content={content} />;
|
||||
}
|
||||
|
||||
if (Object.keys(content).length === 0) {
|
||||
return <EmptyContent />;
|
||||
}
|
||||
|
||||
return (
|
||||
<MText
|
||||
edited={edited}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
ReplyMNotice,
|
||||
ReplyMText,
|
||||
ReplyMLocation,
|
||||
EmptyContent,
|
||||
} from './message';
|
||||
import { MsgType } from '../../types/matrix/common';
|
||||
import { rContent } from '../../client/reader';
|
||||
|
|
@ -124,6 +125,10 @@ export function RenderReplyContent({
|
|||
return <ReplyMLocation content={content} />;
|
||||
}
|
||||
|
||||
if (Object.keys(content).length === 0) {
|
||||
return <EmptyContent size="T300" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<ReplyMText
|
||||
edited={edited}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import {
|
|||
UnsupportedMessageEventType,
|
||||
MessageUnsupportedContent,
|
||||
VideoContent,
|
||||
MessageEmptyContent,
|
||||
} from './content';
|
||||
import { FALLBACK_MIMETYPE, getBlobSafeMimeType } from '../../utils/mimeTypes';
|
||||
import { parseGeoUri, scaleYDimension } from '../../utils/common';
|
||||
|
|
@ -70,6 +71,14 @@ export function BrokenContent({ size }: TextProps) {
|
|||
);
|
||||
}
|
||||
|
||||
export function EmptyContent({ size }: TextProps) {
|
||||
return (
|
||||
<Text size={size}>
|
||||
<MessageEmptyContent />
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
|
||||
type UrlPreviewProps = {
|
||||
body: string;
|
||||
ts: number;
|
||||
|
|
|
|||
Loading…
Reference in a new issue