From 7378d3c1f9502f4632a0d7938112544e0ec2fb4d Mon Sep 17 00:00:00 2001 From: natreex Date: Wed, 7 Jan 2026 20:48:36 -0500 Subject: [PATCH] Remove redundant console logs and comments across components - Cleaned up unused debug logs and comments in `AddNewBookForm`, `QuillConversation`, `OfflinePinSetup`, `OfflinePinVerify`, `ShortStoryGenerator`, and `page.tsx`. - Improved overall code readability and maintainability. --- app/page.tsx | 9 --------- components/ShortStoryGenerator.tsx | 4 +--- components/book/AddNewBookForm.tsx | 2 -- components/offline/OfflinePinSetup.tsx | 4 ---- components/offline/OfflinePinVerify.tsx | 2 -- components/quillsense/modes/QuillConversation.tsx | 2 -- 6 files changed, 1 insertion(+), 22 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index b834cb9..3c20b40 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -268,15 +268,6 @@ function ScribeContent() { setServerOnlyBooks(serverSyncedBooks.filter((serverBook: SyncedBook):boolean => !localSyncedBooks.find((localBook: SyncedBook):boolean => localBook.id === serverBook.id))) setLocalOnlyBooks(localSyncedBooks.filter((localBook: SyncedBook):boolean => !serverSyncedBooks.find((serverBook: SyncedBook):boolean => serverBook.id === localBook.id))) }, [localSyncedBooks, serverSyncedBooks]); - - useEffect((): void => { - console.log('localSyncedBooks', localSyncedBooks); - console.log('serverSyncedBooks', serverSyncedBooks); - console.log('localOnlyBooks', localOnlyBooks); - console.log('serverOnlyBooks', serverOnlyBooks); - console.log('bookSyncDiffsFromServer', bookSyncDiffsFromServer); - console.log('bookSyncDiffsToServer', bookSyncDiffsToServer); - }, [localSyncedBooks, serverSyncedBooks,localOnlyBooks, bookSyncDiffsFromServer, bookSyncDiffsToServer]); async function getBooks(): Promise { diff --git a/components/ShortStoryGenerator.tsx b/components/ShortStoryGenerator.tsx index ca93ca6..d6f538a 100644 --- a/components/ShortStoryGenerator.tsx +++ b/components/ShortStoryGenerator.tsx @@ -222,10 +222,8 @@ export default function ShortStoryGenerator({onClose}: ShortStoryGeneratorProps) if (data.title) { setGeneratedStoryTitle(data.title); } - - // Le message final du endpoint avec title, totalPrice, useYourKey, totalCost + if (data.useYourKey !== undefined && data.totalPrice !== undefined) { - console.log(data); if (data.useYourKey) { setTotalPrice((prev: number): number => prev + data.totalPrice!); } else { diff --git a/components/book/AddNewBookForm.tsx b/components/book/AddNewBookForm.tsx index 259eaf1..78128fe 100644 --- a/components/book/AddNewBookForm.tsx +++ b/components/book/AddNewBookForm.tsx @@ -141,7 +141,6 @@ export default function AddNewBookForm({setCloseForm}: { setCloseForm: Dispatch< if (isCurrentlyOffline()) { bookId = await window.electron.invoke('db:book:create', bookData); } else { - // Online - call API server bookId = await System.authPostToServer('book/add', bookData, token, lang); } @@ -154,7 +153,6 @@ export default function AddNewBookForm({setCloseForm}: { setCloseForm: Dispatch< bookId: bookId, ...bookData }; - console.log(isCurrentlyOffline()) if (isCurrentlyOffline()){ setLocalOnlyBooks((prevBooks: SyncedBook[]): SyncedBook[] => [...prevBooks, { id: book.bookId, diff --git a/components/offline/OfflinePinSetup.tsx b/components/offline/OfflinePinSetup.tsx index 0a1181c..319e2c3 100644 --- a/components/offline/OfflinePinSetup.tsx +++ b/components/offline/OfflinePinSetup.tsx @@ -54,14 +54,10 @@ export default function OfflinePinSetup({ onClose, onSuccess, showOnFirstLogin } try { if (window.electron) { - // Set the PIN const result = await window.electron.offlinePinSet(pin); if (result.success) { - // Enable offline mode await window.electron.offlineModeSet(true, 30); // 30 days sync interval - - console.log('[OfflinePin] PIN configured successfully'); onSuccess?.(); } else { setError(result.error || t('offline.pin.errors.setupFailed')); diff --git a/components/offline/OfflinePinVerify.tsx b/components/offline/OfflinePinVerify.tsx index 8586831..069fbe2 100644 --- a/components/offline/OfflinePinVerify.tsx +++ b/components/offline/OfflinePinVerify.tsx @@ -33,7 +33,6 @@ export default function OfflinePinVerify({ onSuccess, onCancel }: OfflinePinVeri const result = await window.electron.offlinePinVerify(pin); if (result.success && result.userId) { - console.log('[OfflinePin] PIN verified, accessing offline mode'); onSuccess(result.userId); } else { setAttempts(prev => prev + 1); @@ -47,7 +46,6 @@ export default function OfflinePinVerify({ onSuccess, onCancel }: OfflinePinVeri } } } catch (error) { - console.error('[OfflinePin] Error verifying PIN:', error); setError(t('offline.pin.verify.error')); } finally { setIsLoading(false); diff --git a/components/quillsense/modes/QuillConversation.tsx b/components/quillsense/modes/QuillConversation.tsx index b78599d..91c98da 100644 --- a/components/quillsense/modes/QuillConversation.tsx +++ b/components/quillsense/modes/QuillConversation.tsx @@ -239,8 +239,6 @@ export default function QuillConversation( contextType: contextType, version: chapter?.chapterContent.version || null, }, session.accessToken, lang); - console.log(response); - setIsLoading(false); if (response) { setMessages((prevMessages: Message[]): Message[] => {