Embedded Message: Remove loading animation (#3690)

This commit is contained in:
Alexander Zinchuk 2023-07-28 21:33:14 +02:00
parent 725f1b35a1
commit cf4701e4e4
3 changed files with 6 additions and 19 deletions

View File

@ -172,12 +172,4 @@
color: var(--color-text-secondary);
}
}
.embed-loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}

View File

@ -26,12 +26,10 @@ import useThumbnail from '../../hooks/useThumbnail';
import useLang from '../../hooks/useLang';
import { useFastClick } from '../../hooks/useFastClick';
import useMessageTranslation from '../middle/message/hooks/useMessageTranslation';
import useShowTransition from '../../hooks/useShowTransition';
import ActionMessage from '../middle/ActionMessage';
import MessageSummary from './MessageSummary';
import MediaSpoiler from './MediaSpoiler';
import Skeleton from '../ui/Skeleton';
import './EmbeddedMessage.scss';
@ -78,15 +76,10 @@ const EmbeddedMessage: FC<OwnProps> = ({
const isSpoiler = Boolean(message && getMessageIsSpoiler(message));
const shouldTranslate = message && isMessageTranslatable(message);
const { isPending: isTranslationPending, translatedText } = useMessageTranslation(
const { translatedText } = useMessageTranslation(
chatTranslations, message?.chatId, shouldTranslate ? message?.id : undefined, requestedChatTranslationLanguage,
);
const {
shouldRender: shouldRenderLoader,
transitionClassNames,
} = useShowTransition(isTranslationPending || (!message && !customText));
const lang = useLang();
const senderTitle = sender ? getSenderTitle(lang, sender) : message?.forwardInfo?.hiddenUserName;
@ -104,7 +97,6 @@ const EmbeddedMessage: FC<OwnProps> = ({
onClick={message && handleClick}
onMouseDown={message && handleMouseDown}
>
{shouldRenderLoader && <Skeleton className={buildClassName('embed-loading', transitionClassNames)} />}
{mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl, isRoundVideo, isProtected, isSpoiler)}
<div className="message-text">
<p dir="auto">

View File

@ -1,3 +1,4 @@
import { DEBUG } from '../../config';
import { createWorkerInterface } from '../../util/createPostMessageInterface';
import fasttextInitializer from './fasttext-wasm';
import fasttextWasmPath from './fasttext-wasm.wasm';
@ -22,8 +23,10 @@ const fastTextPromise = fasttextInitializer({
},
}).then((fastText: FastTextMethods) => {
fastTextInstance = fastText;
// eslint-disable-next-line no-console
console.log('[FASTTEXT] Worker ready');
if (DEBUG) {
// eslint-disable-next-line no-console
console.log('[FASTTEXT] Worker ready');
}
});
function parseLabel(label: string) {