delete logs and fix hydration error

This commit is contained in:
YasinOnm08 2024-10-11 10:46:05 +02:00
parent 4ed2756b9a
commit 891dabcabf
10 changed files with 37 additions and 70 deletions

View file

@ -7,17 +7,17 @@ const FAQ: React.FC = () => {
<h2>Frequently Asked Questions</h2> {/* Title for the FAQ section */}
<div className="faq-item">
<h3>Why doesn't my selection in the category dropdown menu apply?</h3>
<h3>Why doesn&apos;t my selection in the category dropdown menu apply?</h3>
<p>Currently, the dropdown menu for selecting AI models does not retain your choice after a website refresh.</p>
</div>
<div className="faq-item">
<h3>Why is the AI suddenly talking about the weather when I didn't select that option?</h3>
<p>The AI is programmed to provide weather information even if you haven't specifically selected the weather option.</p>
<h3>Why is the AI suddenly talking about the weather when I didn&apos;t select that option?</h3>
<p>The AI is programmed to provide weather information even if you haven&apos;t specifically selected the weather option.</p>
</div>
<div className="faq-item">
<h3>Why isn't the online API working?</h3>
<h3>Why isn&apos;t the online API working?</h3>
<p>At the moment, the online APIs for Google and La Plateforme are not operational. However, the OpenAI and Anthropic APIs may still function.</p>
</div>
@ -27,7 +27,7 @@ const FAQ: React.FC = () => {
</div>
<div className="faq-item">
<h3>Why isn't the AI responding in the format I specified in the settings?</h3>
<h3>Why isn&apos;t the AI responding in the format I specified in the settings?</h3>
<p>Please check if the system prompt settings are enabled. If the issue persists, it may be because the AI is unable to fully adhere to the command.</p>
</div>

View file

@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { useChatHistory } from '../hooks/useChatHistory'; // Importing the custom hook for chat history
import { setSelectedIndex, useChatHistory } from '../hooks/useChatHistory'; // Importing the custom hook for chat history
const History: React.FC = () => {
// Destructuring values from the useChatHistory hook
const [chatHistory, setSelectedIndex, setChatHistory] = useChatHistory();
const [chatHistory, setChatHistory] = useChatHistory();
const [isEditing, setIsEditing] = useState(false); // State to manage edit mode
const [inputValue, setInputValue] = useState<string>(''); // State for input field
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null); // State to track hovered chat index
@ -29,7 +29,6 @@ const History: React.FC = () => {
// Function to select a chat from the history
const handleHistoryClick = (index: number) => {
setSelectedIndex(index); // Set the selected index to the clicked chat
console.log("index", index);
};
// Function to handle hover over a chat entry
@ -42,10 +41,6 @@ const History: React.FC = () => {
setHoveredIndex(null); // Reset hovered index
};
// Debugging information for chat history length and selected index
console.log("chat length", chatHistory.chats.length);
console.log("index", chatHistory.selectedIndex);
// Function to delete a chat entry
const handleHistoryDeletion = (index: number) => {
const currentIndex = chatHistory.selectedIndex; // Get the currently selected index
@ -71,9 +66,6 @@ const History: React.FC = () => {
copyChats.selectedIndex = newSelectedIndex; // Update the selected index
// Debugging information to inspect the modified chat history
console.log(copyChats);
// Set the updated chat history
setChatHistory(copyChats);
};

View file

@ -34,7 +34,6 @@ export function importSettings(jsonData: string): void {
});
}
console.log("Settings imported successfully!");
} catch (error) {
console.error("Invalid JSON data:", error);
}