mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
fix: remove explicit cast to string for msg.content
This commit is contained in:
@@ -57,7 +57,7 @@ const Message = observer(
|
||||
|
||||
const { openScreen } = useIntermediate();
|
||||
|
||||
const content = message.content as string;
|
||||
const content = message.content;
|
||||
const head =
|
||||
preferHead || (message.reply_ids && message.reply_ids.length > 0);
|
||||
|
||||
@@ -168,7 +168,10 @@ const Message = observer(
|
||||
<Attachment
|
||||
key={index}
|
||||
attachment={attachment}
|
||||
hasContent={index > 0 || content.length > 0}
|
||||
hasContent={
|
||||
index > 0 ||
|
||||
(content ? content.length > 0 : false)
|
||||
}
|
||||
/>
|
||||
))}
|
||||
{message.embeds?.map((embed, index) => (
|
||||
|
||||
@@ -209,7 +209,7 @@ export default function ContextMenus() {
|
||||
.get(data.message.channel)!
|
||||
.sendMessage({
|
||||
nonce: data.message.id,
|
||||
content: data.message.data.content as string,
|
||||
content: data.message.data.content,
|
||||
replies: data.message.data.replies,
|
||||
})
|
||||
.catch(fail);
|
||||
|
||||
@@ -48,7 +48,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function MessageEditor({ message, finish }: Props) {
|
||||
const [content, setContent] = useState((message.content as string) ?? "");
|
||||
const [content, setContent] = useState(message.content ?? "");
|
||||
const { focusTaken } = useContext(IntermediateContext);
|
||||
const { openScreen } = useIntermediate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user