chore: updates

This commit is contained in:
Tristan Yang
2024-09-17 07:53:53 +08:00
parent 06b08fa8aa
commit a32f8c46c9
3 changed files with 6 additions and 10 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vocechat-web",
"version": "0.7.39",
"version": "0.7.40",
"homepage": "https://voce.chat",
"dependencies": {
"@metamask/onboarding": "^1.0.1",
+4 -8
View File
@@ -16,7 +16,8 @@ const ImagePreview = ({ context = "chat" }: Props) => {
if (!container) return;
const chatHandler = (evt: MouseEvent) => {
const target = evt.target as HTMLImageElement;
if (target && target.nodeName == "IMG" && target.classList.contains("preview")) {
const isMsg = !!target.closest(".vc-msg");
if (isMsg && target && target.nodeName == "IMG" && target.classList.contains("preview")) {
// console.log("click chat", target);
evt.stopPropagation();
const thumbnail = target.src;
@@ -28,14 +29,9 @@ const ImagePreview = ({ context = "chat" }: Props) => {
};
const markdownHandler = (evt: MouseEvent) => {
const target = evt.target as HTMLImageElement;
const isMarkdown = !!target.closest("#MARKDOWN_CONTAINER");
const isMsg = !!target.closest(".vc-msg");
// 图片 并且没被 a 标签包裹
if (
isMarkdown &&
target &&
target.nodeName == "IMG" &&
target.parentElement?.tagName !== "A"
) {
if (isMsg && target && target.nodeName == "IMG" && target.parentElement?.tagName !== "A") {
// console.log("click markdown", target);
evt.stopPropagation();
const urlObj = new URL(target.src);
+1 -1
View File
@@ -180,7 +180,7 @@ const Message: FC<IProps> = ({
</div>
<div
className={clsx(
`select-text text-gray-800 text-sm wb whitespace-pre-wrap dark:!text-white pr-6 md:pr-0`,
`vc-msg select-text text-gray-800 text-sm wb whitespace-pre-wrap dark:!text-white pr-6 md:pr-0`,
sending && "opacity-90"
)}
>