This commit is contained in:
Richard Roberson 2025-01-25 23:55:07 -07:00
parent 34d9d4715c
commit 43d34fb2f7

View file

@ -19,7 +19,7 @@ const PDFViewer = dynamic(
export default function PDFViewerPage() {
const { id } = useParams();
const { setCurrentDocument, currDocName } = usePDF();
const { setCurrentDocument, currDocName, clearCurrDoc } = usePDF();
const { setText, stop } = useTTS();
const [error, setError] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(true);
@ -55,9 +55,7 @@ export default function PDFViewerPage() {
<p className="text-red-500 mb-4">{error}</p>
<Link
href="/"
onClick={() => {
}}
onClick={() => {clearCurrDoc(); stop();}}
className="inline-flex items-center px-3 py-1 bg-base text-foreground rounded-lg hover:bg-offbase transition-colors"
>
<svg className="w-4 h-4 mr-2 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">