- 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.
18 lines
492 B
TypeScript
Executable File
18 lines
492 B
TypeScript
Executable File
import {SessionProps} from "@/lib/models/Session";
|
|
import {Context, createContext, Dispatch, SetStateAction} from "react";
|
|
|
|
export interface SessionContextProps {
|
|
session: SessionProps;
|
|
setSession: Dispatch<SetStateAction<SessionProps>>;
|
|
}
|
|
|
|
export const SessionContext: Context<SessionContextProps> = createContext<SessionContextProps>({
|
|
session: {
|
|
isConnected: false,
|
|
accessToken: "",
|
|
user: null,
|
|
},
|
|
setSession: () => {
|
|
},
|
|
})
|