fix: missed copilot switch
This commit is contained in:
parent
cd7722afdb
commit
b45db00a79
1 changed files with 13 additions and 8 deletions
|
@ -15,6 +15,7 @@ const MessageInput = ({
|
||||||
const [message, setMessage] = useState('');
|
const [message, setMessage] = useState('');
|
||||||
const [textareaRows, setTextareaRows] = useState(1);
|
const [textareaRows, setTextareaRows] = useState(1);
|
||||||
const [mode, setMode] = useState<'multi' | 'single'>('single');
|
const [mode, setMode] = useState<'multi' | 'single'>('single');
|
||||||
|
const copilotEnabled = localStorage.getItem('copilotEnabled') === 'true';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (textareaRows >= 2 && message && mode === 'single') {
|
if (textareaRows >= 2 && message && mode === 'single') {
|
||||||
|
@ -56,10 +57,12 @@ const MessageInput = ({
|
||||||
/>
|
/>
|
||||||
{mode === 'single' && (
|
{mode === 'single' && (
|
||||||
<div className="flex flex-row items-center space-x-4">
|
<div className="flex flex-row items-center space-x-4">
|
||||||
|
{copilotEnabled && (
|
||||||
<CopilotToggle
|
<CopilotToggle
|
||||||
copilotToggled={copilotToggled}
|
copilotToggled={copilotToggled}
|
||||||
setCopilotToggled={setCopilotToggled}
|
setCopilotToggled={setCopilotToggled}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
disabled={message.trim().length === 0 || loading}
|
disabled={message.trim().length === 0 || loading}
|
||||||
className="bg-[#24A0ED] text-white disabled:text-white/50 hover:bg-opacity-85 transition duration-100 disabled:bg-[#ececec21] rounded-full p-2"
|
className="bg-[#24A0ED] text-white disabled:text-white/50 hover:bg-opacity-85 transition duration-100 disabled:bg-[#ececec21] rounded-full p-2"
|
||||||
|
@ -72,10 +75,12 @@ const MessageInput = ({
|
||||||
<div className="flex flex-row items-center justify-between w-full pt-2">
|
<div className="flex flex-row items-center justify-between w-full pt-2">
|
||||||
<Attach />
|
<Attach />
|
||||||
<div className="flex flex-row items-center space-x-4">
|
<div className="flex flex-row items-center space-x-4">
|
||||||
|
{copilotEnabled && (
|
||||||
<CopilotToggle
|
<CopilotToggle
|
||||||
copilotToggled={copilotToggled}
|
copilotToggled={copilotToggled}
|
||||||
setCopilotToggled={setCopilotToggled}
|
setCopilotToggled={setCopilotToggled}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
disabled={message.trim().length === 0 || loading}
|
disabled={message.trim().length === 0 || loading}
|
||||||
className="bg-[#24A0ED] text-white disabled:text-white/50 hover:bg-opacity-85 transition duration-100 disabled:bg-[#ececec21] rounded-full p-2"
|
className="bg-[#24A0ED] text-white disabled:text-white/50 hover:bg-opacity-85 transition duration-100 disabled:bg-[#ececec21] rounded-full p-2"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue