Remove SyncService and introduce context-based offline mode and state management
- Delete `SyncService` and its associated bidirectional synchronization logic. - Add multiple context providers (`OfflineProvider`, `AlertProvider`, `LangContext`, `UserContext`, `SessionContext`, `WorldContext`, `SettingBookContext`) for contextual state management. - Implement `SecureStorage` for OS-level secure data encryption and replace dependency on `SyncService` synchronization. - Update localization files (`en.json`, `fr.json`) with offline mode and error-related strings.
This commit is contained in:
13
context/BookContext.ts
Executable file
13
context/BookContext.ts
Executable file
@@ -0,0 +1,13 @@
|
||||
import {Context, createContext, Dispatch, SetStateAction} from "react";
|
||||
import {BookProps} from "@/lib/models/Book";
|
||||
|
||||
export interface BookContextProps {
|
||||
book: BookProps | null,
|
||||
setBook?: Dispatch<SetStateAction<BookProps | null>>
|
||||
}
|
||||
|
||||
export const BookContext: Context<BookContextProps> = createContext<BookContextProps>({
|
||||
book: null,
|
||||
setBook: () => {
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user