diff --git a/src/app/(app)/epub/[id]/page.tsx b/src/app/(app)/epub/[id]/page.tsx
index 5d7904d..bfa5d6d 100644
--- a/src/app/(app)/epub/[id]/page.tsx
+++ b/src/app/(app)/epub/[id]/page.tsx
@@ -102,6 +102,12 @@ export default function EPUBPage() {
loadDocument();
}, [loadDocument, isLoading]);
+ useEffect(() => {
+ return () => {
+ clearCurrDoc();
+ };
+ }, [clearCurrDoc]);
+
// Compute available height = viewport - (header height + tts bar height)
useEffect(() => {
const compute = () => {
@@ -170,7 +176,6 @@ export default function EPUBPage() {
{error}
clearCurrDoc()}
className="inline-flex items-center px-3 py-1 bg-base text-foreground rounded-lg hover:bg-offbase transition-all duration-200 ease-in-out hover:scale-[1.04] hover:text-accent"
>