Add multi-language support and new repository methods for book synchronization
- Extend repository methods to handle API requests for fetching books, chapters, characters, and other entities with multilingual support (`lang: 'fr' | 'en'`). - Add `uploadBookForSync` logic to consolidate and decrypt book data for synchronization. - Refactor schema migration logic to remove console logs and streamline table recreation. - Enhance error handling across database repositories and IPC methods.
This commit is contained in:
@@ -42,8 +42,7 @@ export default function OfflineProvider({ children }: OfflineProviderProps) {
|
||||
isDatabaseInitialized: true,
|
||||
error: null
|
||||
}));
|
||||
|
||||
console.log('Database initialized successfully for user:', userId);
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('Failed to initialize database:', error);
|
||||
@@ -57,17 +56,9 @@ export default function OfflineProvider({ children }: OfflineProviderProps) {
|
||||
}, []);
|
||||
|
||||
const toggleOfflineMode = useCallback(() => {
|
||||
setOfflineMode(prev => {
|
||||
const newManuallyOffline = !prev.isManuallyOffline;
|
||||
const newIsOffline = newManuallyOffline || !prev.isNetworkOnline;
|
||||
|
||||
console.log('Toggle offline mode:', {
|
||||
wasManuallyOffline: prev.isManuallyOffline,
|
||||
nowManuallyOffline: newManuallyOffline,
|
||||
wasOffline: prev.isOffline,
|
||||
nowOffline: newIsOffline,
|
||||
networkOnline: prev.isNetworkOnline
|
||||
});
|
||||
setOfflineMode((prev:OfflineMode):OfflineMode => {
|
||||
const newManuallyOffline:boolean = !prev.isManuallyOffline;
|
||||
const newIsOffline:boolean = newManuallyOffline || !prev.isNetworkOnline;
|
||||
|
||||
return {
|
||||
...prev,
|
||||
|
||||
Reference in New Issue
Block a user