fix(BingAI): show censored message, fix toneStyle UI bug (#644)

* fix(frontend/BingAI): prevent Settings from not showing on new conversation, also prevent showing toneStyle change without jailbreak

* fix(Input/index.jsx): fix typo in comment, change "also prevents toneStyle change without jailbreak" to "also prevents showing toneStyle change without jailbreak"

* fix(BingAI): show message despite censor trigger
This commit is contained in:
Danny Avila 2023-07-14 10:57:24 -04:00 committed by GitHub
parent 1a5144be76
commit 1a21eb5bae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 100 additions and 48 deletions

View file

@ -11,7 +11,7 @@ import NewConversationMenu from './NewConversationMenu';
import AdjustToneButton from './AdjustToneButton';
import Footer from './Footer';
import TextareaAutosize from 'react-textarea-autosize';
import { useMessageHandler } from '../../utils/handleSubmit';
import { useMessageHandler } from '~/utils/handleSubmit';
import store from '~/store';
@ -36,8 +36,20 @@ export default function TextChat({ isSearchView = false }) {
// auto focus to input, when enter a conversation.
useEffect(() => {
if (conversation?.conversationId !== 'search') inputRef.current?.focus();
}, [conversation?.conversationId]);
const { conversationId } = conversation || {};
if (!conversationId) {
return;
}
// Prevents Settings from not showing on new conversation, also prevents showing toneStyle change without jailbreak
if (conversationId === 'new' || !conversation?.jailbreak) {
setShowBingToneSetting(false);
}
if (conversationId !== 'search') {
inputRef.current?.focus();
}
}, [conversation]);
useEffect(() => {
const timeoutId = setTimeout(() => {
@ -146,7 +158,7 @@ export default function TextChat({ isSearchView = false }) {
>
<NewConversationMenu />
<TextareaAutosize
// set test id for e2e testing
// set test id for e2e testing
data-testid="text-input"
tabIndex="0"
autoFocus