Refactor components to improve logging and remove console statements

- Removed unnecessary console logs from ImportLocal, TextToSpeech, Header, and Viewer components to clean up the code and enhance performance.
- Streamlined the components for better readability and maintainability by eliminating debug statements that are no longer needed.
This commit is contained in:
troyeguo
2026-06-03 15:44:10 +08:00
parent 193393bc8d
commit 8535da00ad
5 changed files with 1 additions and 7 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -89,7 +89,6 @@ class ImportLocal extends React.Component<ImportLocalProps, ImportLocalState> {
ipcRenderer.on("import-url-from-link", this.ipcImportUrlListener);
}
this.resizeHandler = throttle(() => {
console.log("resize");
this.setState({ width: document.body.clientWidth });
});
window.addEventListener("resize", this.resizeHandler);

View File

@@ -557,7 +557,6 @@ class TextToSpeech extends React.Component<
let nodeTextList = (await this.props.htmlBook.rendition.audioText()).filter(
(item: string) => item && item.trim()
);
console.log("nodeTextList", nodeTextList);
let rawNodeList: string[][] = [];
if (
this.props.currentBook.format === "PDF" &&

View File

@@ -161,9 +161,6 @@ class Header extends React.Component<HeaderProps, HeaderState> {
} else {
upgradeConfig();
const status = await LocalFileManager.getPermissionStatus();
console.log(status, "status");
console.log(ConfigService.getReaderConfig("isUseLocal"), "isUseLocal");
console.log(LocalFileManager.isSupported(), "isSupported");
if (
!ConfigService.getReaderConfig("isUseLocal") &&
LocalFileManager.isSupported()

View File

@@ -124,7 +124,6 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
}
}
handleHighlight = async (rendition: any) => {
console.log("handleHighlight", rendition);
if (!rendition) return;
let highlighters: any = await DatabaseService.getRecordsByBookKey(
this.props.currentBook.key,