feat: Clearing cache automatically after quitting e read session

This commit is contained in:
Julien Froidefond
2025-02-28 17:44:22 +01:00
parent 2ef5eee726
commit 13492cea84
5 changed files with 45 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ export function Header({ onToggleSidebar }: HeaderProps) {
className="px-2 py-1.5 hover:bg-accent hover:text-accent-foreground rounded-md"
aria-label="Toggle theme"
>
<div className="relative flex items-center justify-center w-5 h-5">
<div className="relative flex items-center w-5 h-5">
<Sun className="absolute inset-0 h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute inset-0 h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
</div>

View File

@@ -21,6 +21,7 @@ export function ClientBookReader({ book, pages }: ClientBookReaderProps) {
const handleCloseReader = () => {
setIsReading(false);
//Fetch une nouvelle route pour rafraichir les différents caches
router.back();
};

View File

@@ -13,6 +13,9 @@ export function ClientBookWrapper({ book, pages }: ClientBookWrapperProps) {
const router = useRouter();
const handleCloseReader = () => {
fetch(`/api/komga/cache/clear/${book.libraryId}/${book.seriesId}`, {
method: "POST",
});
router.back();
};