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.
This commit is contained in:
natreex
2026-01-07 20:48:36 -05:00
parent 8eab6fd771
commit 7378d3c1f9
6 changed files with 1 additions and 22 deletions

View File

@@ -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<void> {

View File

@@ -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 {

View File

@@ -141,7 +141,6 @@ export default function AddNewBookForm({setCloseForm}: { setCloseForm: Dispatch<
if (isCurrentlyOffline()) {
bookId = await window.electron.invoke<string>('db:book:create', bookData);
} else {
// Online - call API server
bookId = await System.authPostToServer<string>('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,

View File

@@ -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'));

View File

@@ -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);

View File

@@ -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[] => {