mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 04:12:41 +03: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 || [];
|
||||
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
||||
const inlineTranslate = useMemo(() => {
|
||||
const contentLength = htmlContentLength(content);
|
||||
return (
|
||||
!readOnly &&
|
||||
(!withinContext || isSizeLarge) &&
|
||||
!previewMode &&
|
||||
!withinContext &&
|
||||
!spoilerText &&
|
||||
!poll &&
|
||||
!mediaAttachments?.length &&
|
||||
content?.length > 0 &&
|
||||
content?.length <= INLINE_TRANSLATE_LIMIT
|
||||
contentLength > 0 &&
|
||||
contentLength <= INLINE_TRANSLATE_LIMIT
|
||||
);
|
||||
}, [
|
||||
readOnly,
|
||||
previewMode,
|
||||
withinContext,
|
||||
isSizeLarge,
|
||||
previewMode,
|
||||
spoilerText,
|
||||
poll,
|
||||
mediaAttachments,
|
||||
|
|
Loading…
Reference in a new issue