mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 04:12:41 +03:00
Fix logic again
I really need to rename these variables to be less confusing
This commit is contained in:
parent
28ad18bd0b
commit
eb13fe8ce0
1 changed files with 21 additions and 12 deletions
|
@ -251,26 +251,35 @@ function Status({
|
|||
const targetLanguage = getTranslateTargetLanguage(true);
|
||||
const contentTranslationHideLanguages =
|
||||
snapStates.settings.contentTranslationHideLanguages || [];
|
||||
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
||||
const { contentTranslation, contentTranslationAutoInline } =
|
||||
snapStates.settings;
|
||||
if (!contentTranslation) enableTranslate = false;
|
||||
const inlineTranslate = useMemo(() => {
|
||||
if (
|
||||
!contentTranslation ||
|
||||
!contentTranslationAutoInline ||
|
||||
readOnly ||
|
||||
(withinContext && !isSizeLarge) ||
|
||||
previewMode ||
|
||||
spoilerText ||
|
||||
sensitive ||
|
||||
poll ||
|
||||
card ||
|
||||
mediaAttachments?.length
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
const contentLength = htmlContentLength(content);
|
||||
return (
|
||||
!readOnly &&
|
||||
(!withinContext || isSizeLarge) &&
|
||||
!previewMode &&
|
||||
!spoilerText &&
|
||||
!poll &&
|
||||
!card &&
|
||||
!mediaAttachments?.length &&
|
||||
contentLength > 0 &&
|
||||
contentLength <= INLINE_TRANSLATE_LIMIT
|
||||
);
|
||||
return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;
|
||||
}, [
|
||||
contentTranslation,
|
||||
contentTranslationAutoInline,
|
||||
readOnly,
|
||||
withinContext,
|
||||
isSizeLarge,
|
||||
previewMode,
|
||||
spoilerText,
|
||||
sensitive,
|
||||
poll,
|
||||
card,
|
||||
mediaAttachments,
|
||||
|
|
Loading…
Reference in a new issue