Make tone adjustment available after conversation started if sydney

This commit is contained in:
Hyunggyu Jang 2023-03-26 13:01:35 +09:00
parent e8e512a451
commit 55f04ffa60
3 changed files with 45 additions and 6 deletions

View file

@ -9,15 +9,15 @@ function BingStyles(props, ref) {
const { model } = useSelector((state) => state.submit);
const { conversationId } = useSelector((state) => state.convo);
const { messages } = useSelector((state) => state.messages);
const isBing = model === 'bingai' || model === 'sydney';
useEffect(() => {
if (isBing && !conversationId) {
if (isBing) {
dispatch(setConversation({ toneStyle: value }));
}
}, [isBing, conversationId, model, value, dispatch]);
const show = isBing && (!conversationId || messages?.length === 0);
const show = isBing && ((!conversationId || messages?.length === 0) || props.show);
const defaultClasses = 'p-2 rounded-md font-normal bg-white/[.60] dark:bg-gray-700 text-black';
const defaultSelected = defaultClasses + 'font-medium data-[state=active]:text-white';