Backend fixes by Yasin #24

Merged
sageTheDm merged 4 commits from React-Group/interstellar_ai:main into main 2024-09-26 16:11:14 +02:00
Showing only changes of commit 85deb5d64b - Show all commits

View file

@ -29,12 +29,13 @@ const modelDropdown = {
const Models: React.FC = () => {
// Initialize state with value from localStorage or default to ''
const [radioSelection, setRadioSelection] = useState(() => localStorage.getItem('radioSelection') || '');
const [radioSelection, setRadioSelection] = useState('');
useEffect(() => {
const handleStorageChange = () => {
setRadioSelection(localStorage.getItem('radioSelection') || '');
};
handleStorageChange()
// Update dropdown immediately when localStorage changes internally or externally
window.addEventListener('storage', handleStorageChange);