Embedded Message: Remove loading animation (#3690)
This commit is contained in:
parent
725f1b35a1
commit
cf4701e4e4
@ -172,12 +172,4 @@
|
|||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.embed-loading {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,12 +26,10 @@ import useThumbnail from '../../hooks/useThumbnail';
|
|||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
import { useFastClick } from '../../hooks/useFastClick';
|
import { useFastClick } from '../../hooks/useFastClick';
|
||||||
import useMessageTranslation from '../middle/message/hooks/useMessageTranslation';
|
import useMessageTranslation from '../middle/message/hooks/useMessageTranslation';
|
||||||
import useShowTransition from '../../hooks/useShowTransition';
|
|
||||||
|
|
||||||
import ActionMessage from '../middle/ActionMessage';
|
import ActionMessage from '../middle/ActionMessage';
|
||||||
import MessageSummary from './MessageSummary';
|
import MessageSummary from './MessageSummary';
|
||||||
import MediaSpoiler from './MediaSpoiler';
|
import MediaSpoiler from './MediaSpoiler';
|
||||||
import Skeleton from '../ui/Skeleton';
|
|
||||||
|
|
||||||
import './EmbeddedMessage.scss';
|
import './EmbeddedMessage.scss';
|
||||||
|
|
||||||
@ -78,15 +76,10 @@ const EmbeddedMessage: FC<OwnProps> = ({
|
|||||||
const isSpoiler = Boolean(message && getMessageIsSpoiler(message));
|
const isSpoiler = Boolean(message && getMessageIsSpoiler(message));
|
||||||
|
|
||||||
const shouldTranslate = message && isMessageTranslatable(message);
|
const shouldTranslate = message && isMessageTranslatable(message);
|
||||||
const { isPending: isTranslationPending, translatedText } = useMessageTranslation(
|
const { translatedText } = useMessageTranslation(
|
||||||
chatTranslations, message?.chatId, shouldTranslate ? message?.id : undefined, requestedChatTranslationLanguage,
|
chatTranslations, message?.chatId, shouldTranslate ? message?.id : undefined, requestedChatTranslationLanguage,
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
|
||||||
shouldRender: shouldRenderLoader,
|
|
||||||
transitionClassNames,
|
|
||||||
} = useShowTransition(isTranslationPending || (!message && !customText));
|
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
const senderTitle = sender ? getSenderTitle(lang, sender) : message?.forwardInfo?.hiddenUserName;
|
const senderTitle = sender ? getSenderTitle(lang, sender) : message?.forwardInfo?.hiddenUserName;
|
||||||
@ -104,7 +97,6 @@ const EmbeddedMessage: FC<OwnProps> = ({
|
|||||||
onClick={message && handleClick}
|
onClick={message && handleClick}
|
||||||
onMouseDown={message && handleMouseDown}
|
onMouseDown={message && handleMouseDown}
|
||||||
>
|
>
|
||||||
{shouldRenderLoader && <Skeleton className={buildClassName('embed-loading', transitionClassNames)} />}
|
|
||||||
{mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl, isRoundVideo, isProtected, isSpoiler)}
|
{mediaThumbnail && renderPictogram(mediaThumbnail, mediaBlobUrl, isRoundVideo, isProtected, isSpoiler)}
|
||||||
<div className="message-text">
|
<div className="message-text">
|
||||||
<p dir="auto">
|
<p dir="auto">
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { DEBUG } from '../../config';
|
||||||
import { createWorkerInterface } from '../../util/createPostMessageInterface';
|
import { createWorkerInterface } from '../../util/createPostMessageInterface';
|
||||||
import fasttextInitializer from './fasttext-wasm';
|
import fasttextInitializer from './fasttext-wasm';
|
||||||
import fasttextWasmPath from './fasttext-wasm.wasm';
|
import fasttextWasmPath from './fasttext-wasm.wasm';
|
||||||
@ -22,8 +23,10 @@ const fastTextPromise = fasttextInitializer({
|
|||||||
},
|
},
|
||||||
}).then((fastText: FastTextMethods) => {
|
}).then((fastText: FastTextMethods) => {
|
||||||
fastTextInstance = fastText;
|
fastTextInstance = fastText;
|
||||||
// eslint-disable-next-line no-console
|
if (DEBUG) {
|
||||||
console.log('[FASTTEXT] Worker ready');
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('[FASTTEXT] Worker ready');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function parseLabel(label: string) {
|
function parseLabel(label: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user