mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 17:13:15 +00:00
fix(stream err on changing conversation)
This commit is contained in:
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user