mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-23 14:13:21 +01:00
Getting confused with the logic
Also more accurate content length calc
This commit is contained in:
parent
658872cbd9
commit
587864893c
1 changed files with 6 additions and 4 deletions
|
@ -253,20 +253,22 @@ function Status({
|
||||||
snapStates.settings.contentTranslationHideLanguages || [];
|
snapStates.settings.contentTranslationHideLanguages || [];
|
||||||
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
||||||
const inlineTranslate = useMemo(() => {
|
const inlineTranslate = useMemo(() => {
|
||||||
|
const contentLength = htmlContentLength(content);
|
||||||
return (
|
return (
|
||||||
!readOnly &&
|
!readOnly &&
|
||||||
|
(!withinContext || isSizeLarge) &&
|
||||||
!previewMode &&
|
!previewMode &&
|
||||||
!withinContext &&
|
|
||||||
!spoilerText &&
|
!spoilerText &&
|
||||||
!poll &&
|
!poll &&
|
||||||
!mediaAttachments?.length &&
|
!mediaAttachments?.length &&
|
||||||
content?.length > 0 &&
|
contentLength > 0 &&
|
||||||
content?.length <= INLINE_TRANSLATE_LIMIT
|
contentLength <= INLINE_TRANSLATE_LIMIT
|
||||||
);
|
);
|
||||||
}, [
|
}, [
|
||||||
readOnly,
|
readOnly,
|
||||||
previewMode,
|
|
||||||
withinContext,
|
withinContext,
|
||||||
|
isSizeLarge,
|
||||||
|
previewMode,
|
||||||
spoilerText,
|
spoilerText,
|
||||||
poll,
|
poll,
|
||||||
mediaAttachments,
|
mediaAttachments,
|
||||||
|
|
Loading…
Add table
Reference in a new issue