- 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.
26 lines
585 B
TypeScript
Executable File
26 lines
585 B
TypeScript
Executable File
import {UserProps} from "@/lib/models/User";
|
|
import {Context, createContext} from "react";
|
|
|
|
export interface UserContextProps {
|
|
user: UserProps
|
|
}
|
|
|
|
export const UserContext: Context<UserContextProps> = createContext<UserContextProps>({
|
|
user: {
|
|
id: '',
|
|
name: '',
|
|
lastName: '',
|
|
username: '',
|
|
writingLang: 0,
|
|
writingLevel: 0,
|
|
ritePoints: 0,
|
|
groupId: 0,
|
|
aiUsage: 0,
|
|
apiKeys: {
|
|
openai: false,
|
|
anthropic: false,
|
|
gemini: false,
|
|
}
|
|
}
|
|
})
|