Skip to content

Commit 5edae0e

Browse files
committed
cleanup
1 parent 68fa328 commit 5edae0e

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "next dev --turbopack",
77
"build": "next build",
8-
"start": "next start",
8+
"start": "next start -p 3002",
99
"lint": "next lint"
1010
},
1111
"dependencies": {

src/app/layout.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "./globals.css";
22
import { Providers } from "./providers";
3-
import TTSPlayer from "@/components/TTSPlayer";
43
import { Metadata } from "next";
4+
import Script from "next/script";
55

66
export const metadata: Metadata = {
77
title: "OpenReader WebUI",
@@ -17,13 +17,7 @@ export default function RootLayout({
1717
<html lang="en" suppressHydrationWarning>
1818
<head>
1919
<meta name="color-scheme" content="light dark" />
20-
<script src="/theme.js" />
21-
<style dangerouslySetInnerHTML={{ __html: `
22-
:root { color-scheme: light dark; }
23-
html.dark { color-scheme: dark; }
24-
html.light { color-scheme: light; }
25-
html { background: var(--background); }
26-
`}} />
20+
<Script src="/theme.js" strategy="beforeInteractive" />
2721
</head>
2822
<body className="antialiased">
2923
<Providers>

src/components/DocumentList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function DocumentList() {
134134
</DialogTitle>
135135
<div className="mt-2">
136136
<p className="text-sm text-muted">
137-
Are you sure you want to delete "{documentToDelete?.name}"? This action cannot be undone.
137+
Are you sure you want to delete <span className='font-bold'>{documentToDelete?.name}</span>? This action cannot be undone.
138138
</p>
139139
</div>
140140

src/components/PDFViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function PDFViewer({ pdfData }: PDFViewerProps) {
4040
return () => {
4141
styleElement.remove();
4242
};
43-
}, []);
43+
}, [styleElement]);
4444

4545
useEffect(() => {
4646
/*

src/components/TTSPlayer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import React, { useState } from 'react';
43
import { useTTS } from '@/contexts/TTSContext';
54
import { Button, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/react';
65
import {
@@ -33,7 +32,6 @@ const speedOptions = [
3332
];
3433

3534
export default function TTSPlayer() {
36-
const [isVisible, setIsVisible] = useState(true);
3735
const {
3836
isPlaying,
3937
togglePlay,
@@ -51,8 +49,7 @@ export default function TTSPlayer() {
5149

5250
return (
5351
<div
54-
className={`fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 ${isVisible ? 'opacity-100' : 'opacity-0'
55-
} transition-opacity duration-300`}
52+
className={`fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 transition-opacity duration-300`}
5653
>
5754
<div className="bg-base dark:bg-base rounded-full shadow-lg px-4 py-1 flex items-center space-x-1 relative">
5855
<div className="relative">

src/contexts/PDFContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import stringSimilarity from 'string-similarity';
1616
import nlp from 'compromise';
1717

1818
// Add the correct type import
19-
import type { TextContent, TextItem } from 'pdfjs-dist/types/src/display/api';
19+
import type { TextItem } from 'pdfjs-dist/types/src/display/api';
2020
import { useConfig } from '@/contexts/ConfigContext';
2121

2222
// Set worker from public directory
@@ -232,7 +232,7 @@ export function PDFProvider({ children }: { children: ReactNode }) {
232232

233233
for (let i = 0; i < elements.length; i++) {
234234
let combinedText = '';
235-
let currentElements = [];
235+
const currentElements = [];
236236
for (let j = i; j < Math.min(i + 10, elements.length); j++) {
237237
const node = elements[j];
238238
const newText = combinedText ? `${combinedText} ${node.text}` : node.text;

src/contexts/TTSContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export function TTSProvider({ children }: { children: React.ReactNode }) {
6464
const [audioContext, setAudioContext] = useState<AudioContextType>(null);
6565
const currentRequestRef = useRef<AbortController | null>(null);
6666
const [activeSource, setActiveSource] = useState<AudioBufferSourceNode | null>(null);
67-
const [audioQueue, setAudioQueue] = useState<AudioBuffer[]>([]);
68-
const [currentAudioIndex, setCurrentAudioIndex] = useState(0);
67+
const [audioQueue] = useState<AudioBuffer[]>([]);
68+
const [currentAudioIndex] = useState(0);
6969
const [isProcessing, setIsProcessing] = useState(false);
7070
const skipTriggeredRef = useRef(false);
7171
const skipTimeoutRef = useRef<NodeJS.Timeout | null>(null);

0 commit comments

Comments
 (0)