mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-27 11:49:16 +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 targetLanguage = getTranslateTargetLanguage(true);
|
||||||
const contentTranslationHideLanguages =
|
const contentTranslationHideLanguages =
|
||||||
snapStates.settings.contentTranslationHideLanguages || [];
|
snapStates.settings.contentTranslationHideLanguages || [];
|
||||||
if (!snapStates.settings.contentTranslation) enableTranslate = false;
|
const { contentTranslation, contentTranslationAutoInline } =
|
||||||
|
snapStates.settings;
|
||||||
|
if (!contentTranslation) enableTranslate = false;
|
||||||
const inlineTranslate = useMemo(() => {
|
const inlineTranslate = useMemo(() => {
|
||||||
|
if (
|
||||||
|
!contentTranslation ||
|
||||||
|
!contentTranslationAutoInline ||
|
||||||
|
readOnly ||
|
||||||
|
(withinContext && !isSizeLarge) ||
|
||||||
|
previewMode ||
|
||||||
|
spoilerText ||
|
||||||
|
sensitive ||
|
||||||
|
poll ||
|
||||||
|
card ||
|
||||||
|
mediaAttachments?.length
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const contentLength = htmlContentLength(content);
|
const contentLength = htmlContentLength(content);
|
||||||
return (
|
return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;
|
||||||
!readOnly &&
|
|
||||||
(!withinContext || isSizeLarge) &&
|
|
||||||
!previewMode &&
|
|
||||||
!spoilerText &&
|
|
||||||
!poll &&
|
|
||||||
!card &&
|
|
||||||
!mediaAttachments?.length &&
|
|
||||||
contentLength > 0 &&
|
|
||||||
contentLength <= INLINE_TRANSLATE_LIMIT
|
|
||||||
);
|
|
||||||
}, [
|
}, [
|
||||||
|
contentTranslation,
|
||||||
|
contentTranslationAutoInline,
|
||||||
readOnly,
|
readOnly,
|
||||||
withinContext,
|
withinContext,
|
||||||
isSizeLarge,
|
isSizeLarge,
|
||||||
previewMode,
|
previewMode,
|
||||||
spoilerText,
|
spoilerText,
|
||||||
|
sensitive,
|
||||||
poll,
|
poll,
|
||||||
card,
|
card,
|
||||||
mediaAttachments,
|
mediaAttachments,
|
||||||
|
|
Loading…
Add table
Reference in a new issue