fix: fix problem which allow operate to local message

add flag to hide it
pull/105/merge
moonrailgun 2 years ago
parent 58f7144c31
commit 9fb024659b

@ -75,6 +75,10 @@ const NormalMessage: React.FC<ChatMessageItemProps> = React.memo((props) => {
}, },
}); });
// 禁止对消息进行操作,因为此时消息尚未发送到远程
const disableOperate =
payload.isLocal === true || payload.sendFailed === true;
return ( return (
<div <div
className={clsx( className={clsx(
@ -169,6 +173,7 @@ const NormalMessage: React.FC<ChatMessageItemProps> = React.memo((props) => {
</div> </div>
{/* 操作 */} {/* 操作 */}
{!disableOperate && (
<div <div
className={clsx( className={clsx(
'bg-white dark:bg-black rounded absolute right-2 cursor-pointer -top-3 shadow-sm flex', 'bg-white dark:bg-black rounded absolute right-2 cursor-pointer -top-3 shadow-sm flex',
@ -202,6 +207,7 @@ const NormalMessage: React.FC<ChatMessageItemProps> = React.memo((props) => {
</div> </div>
</Dropdown> </Dropdown>
</div> </div>
)}
</div> </div>
); );
}); });

Loading…
Cancel
Save