fix(stream err on changing conversation)

This commit is contained in:
ManishMadan2882
2024-02-07 04:42:39 +05:30
parent 300430e2d5
commit 3c68cbc955
5 changed files with 36 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ export function useDarkTheme() {
useEffect(() => {
// Check if dark mode preference exists in local storage
const savedMode:string | null = localStorage.getItem('selectedTheme');
const savedMode: string | null = localStorage.getItem('selectedTheme');
// Set dark mode based on local storage preference
if (savedMode === 'Dark') {
@@ -83,22 +83,19 @@ export function useDarkTheme() {
document.documentElement.classList.remove('dark');
}
}, []);
useEffect(()=>{
localStorage.setItem('selectedTheme',isDarkTheme ? 'Dark' : 'Light');
if(isDarkTheme){
useEffect(() => {
localStorage.setItem('selectedTheme', isDarkTheme ? 'Dark' : 'Light');
if (isDarkTheme) {
document.documentElement.classList.add('dark');
document.documentElement.classList.add('dark:bg-raisin-black');
}
else{
else {
document.documentElement.classList.remove('dark');
}
},[isDarkTheme])
// Function to toggle dark mode
const toggleTheme:any = () => {
}, [isDarkTheme])
//method to toggle theme
const toggleTheme: any = () => {
setIsDarkTheme(!isDarkTheme)
};
return [isDarkTheme, toggleTheme];
}