Various improvements

This commit is contained in:
Stefan Hardegger
2025-08-21 13:55:38 +02:00
parent 35a5825e76
commit a660056003
11 changed files with 829 additions and 55 deletions

View File

@@ -6,6 +6,7 @@ import Button from '../ui/Button';
import { Input } from '../ui/Input';
import LibrarySwitchLoader from '../ui/LibrarySwitchLoader';
import { useLibrarySwitch } from '../../hooks/useLibrarySwitch';
import { setCurrentLibraryId, clearLibraryCache } from '../../lib/api';
interface Library {
id: string;
@@ -65,6 +66,8 @@ export default function LibrarySettings() {
if (response.ok) {
const data = await response.json();
setCurrentLibrary(data);
// Set the library ID for image URL generation
setCurrentLibraryId(data.id);
}
} catch (error) {
console.error('Failed to load current library:', error);
@@ -87,6 +90,8 @@ export default function LibrarySettings() {
};
const handleSwitchComplete = () => {
// Clear the library cache so images use the new library
clearLibraryCache();
// Refresh the page to reload with new library context
router.refresh();
window.location.reload();