mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix typo and logic
This commit is contained in:
parent
58bf8e16c2
commit
5502d08d28
1 changed files with 15 additions and 6 deletions
|
@ -57,7 +57,7 @@ import MenuLink from './menu-link';
|
|||
import RelativeTime from './relative-time';
|
||||
import TranslationBlock from './translation-block';
|
||||
|
||||
const INLINE_TRASNSLATE_LIMIT = 140;
|
||||
const INLINE_TRANSLATE_LIMIT = 140;
|
||||
const throttle = pThrottle({
|
||||
limit: 1,
|
||||
interval: 1000,
|
||||
|
@ -254,13 +254,24 @@ function Status({
|
|||
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
||||
const inlineTranslate = useMemo(() => {
|
||||
return (
|
||||
!readOnly &&
|
||||
!previewMode &&
|
||||
!withinContext &&
|
||||
!spoilerText &&
|
||||
!poll &&
|
||||
!mediaAttachments?.length &&
|
||||
content?.length > 0 &&
|
||||
content?.length <= INLINE_TRASNSLATE_LIMIT
|
||||
content?.length <= INLINE_TRANSLATE_LIMIT
|
||||
);
|
||||
}, [isSizeLarge, content, spoilerText, poll, mediaAttachments]);
|
||||
}, [
|
||||
readOnly,
|
||||
previewMode,
|
||||
withinContext,
|
||||
spoilerText,
|
||||
poll,
|
||||
mediaAttachments,
|
||||
content,
|
||||
]);
|
||||
|
||||
const [showEdited, setShowEdited] = useState(false);
|
||||
const [showReactions, setShowReactions] = useState(false);
|
||||
|
@ -1103,9 +1114,7 @@ function Status({
|
|||
}}
|
||||
/>
|
||||
)}
|
||||
{(((enableTranslate || inlineTranslate) &&
|
||||
!!content.trim() &&
|
||||
differentLanguage) ||
|
||||
{((enableTranslate && !!content.trim() && differentLanguage) ||
|
||||
forceTranslate) && (
|
||||
<TranslationBlock
|
||||
forceTranslate={forceTranslate || inlineTranslate}
|
||||
|
|
Loading…
Reference in a new issue