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:
10
context/WorldContext.ts
Executable file
10
context/WorldContext.ts
Executable file
@@ -0,0 +1,10 @@
|
||||
import {WorldProps} from "@/lib/models/World";
|
||||
import {createContext, Dispatch, SetStateAction} from "react";
|
||||
|
||||
export interface WorldContextProps {
|
||||
worlds: WorldProps[];
|
||||
setWorlds: Dispatch<SetStateAction<WorldProps[]>>;
|
||||
selectedWorldIndex: number;
|
||||
}
|
||||
|
||||
export const WorldContext = createContext<WorldContextProps>({} as WorldContextProps);
|
||||
Reference in New Issue
Block a user