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:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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[] => {
|
||||
|
||||
Reference in New Issue
Block a user