💫 fix: catch constant conditions in recoil state usage (#3513)

* chore: modify eslintrc

* fix: apply new rules, avoid using getter/setter tuples in conditions

---------

Co-authored-by: Alexandre Germain <nihilivin@gmail.com>
This commit is contained in:
Gerkin 2024-08-01 20:10:42 +02:00 committed by GitHub
parent e15d0d354d
commit cd326c4cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 12 deletions

View file

@ -38,8 +38,8 @@ const ChatForm = ({ index = 0 }) => {
const submitButtonRef = useRef<HTMLButtonElement>(null);
const textAreaRef = useRef<HTMLTextAreaElement | null>(null);
const SpeechToText = useRecoilState<boolean>(store.speechToText);
const TextToSpeech = useRecoilState<boolean>(store.textToSpeech);
const SpeechToText = useRecoilValue(store.speechToText);
const TextToSpeech = useRecoilValue(store.textToSpeech);
const automaticPlayback = useRecoilValue(store.automaticPlayback);
const [showStopButton, setShowStopButton] = useRecoilState(store.showStopButtonByIndex(index));
@ -106,7 +106,7 @@ const ChatForm = ({ index = 0 }) => {
() =>
isAssistantsEndpoint(conversation?.endpoint) &&
(!conversation?.assistant_id ||
!assistantMap?.[conversation?.endpoint ?? '']?.[conversation?.assistant_id ?? '']),
!assistantMap[conversation.endpoint ?? ''][conversation.assistant_id ?? '']),
[conversation?.assistant_id, conversation?.endpoint, assistantMap],
);
const disableInputs = useMemo(