Enhance synchronization logic and offline handling

- Refactor components to support conditional offline and online CRUD operations.
- Introduce `addToQueue` mechanism for syncing offline changes to the server.
- Add `isChapterContentExist` method and related existence checks in repositories.
- Consolidate data structures and streamline book, chapter, character, and guideline synchronization workflows.
- Encrypt additional character fields and adjust repository inserts for offline data.
This commit is contained in:
natreex
2026-01-07 20:43:34 -05:00
parent fa05d6dbae
commit 8eab6fd771
21 changed files with 557 additions and 578 deletions

View File

@@ -8,6 +8,8 @@ export interface BooksSyncContextProps {
localSyncedBooks:SyncedBook[];
booksToSyncFromServer:BookSyncCompare[];
booksToSyncToServer:BookSyncCompare[];
setServerSyncedBooks:Dispatch<SetStateAction<SyncedBook[]>>;
setLocalSyncedBooks:Dispatch<SetStateAction<SyncedBook[]>>;
setServerOnlyBooks:Dispatch<SetStateAction<SyncedBook[]>>;
setLocalOnlyBooks:Dispatch<SetStateAction<SyncedBook[]>>;
serverOnlyBooks:SyncedBook[];
@@ -19,6 +21,8 @@ export const BooksSyncContext:Context<BooksSyncContextProps> = createContext<Boo
localSyncedBooks:[],
booksToSyncFromServer:[],
booksToSyncToServer:[],
setServerSyncedBooks:():void => {},
setLocalSyncedBooks:():void => {},
setServerOnlyBooks:():void => {},
setLocalOnlyBooks:():void => {},
serverOnlyBooks:[],