refactor: replace secure storage with app storage across components and hooks
This commit is contained in:
@@ -16,21 +16,21 @@ import './main.css';
|
||||
import { lazy, StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { setupI18n } from '@repo/core-i18n';
|
||||
import { secureStorage, AppStorageKey } from './core/storage/local';
|
||||
import { appStorage, AppStorageKey } from './core/storage/local';
|
||||
import { ENV } from './core/environment';
|
||||
|
||||
const App = lazy(() => import('./apps'));
|
||||
|
||||
async function bootstrap() {
|
||||
// Initialize i18next and load language from secureStorage
|
||||
// Initialize i18next and load language from appStorage
|
||||
await setupI18n(
|
||||
{
|
||||
storageAdapter: {
|
||||
getLanguage: async () => {
|
||||
return secureStorage.getItem<string>(AppStorageKey.LANGUAGE);
|
||||
return appStorage.getItem<string>(AppStorageKey.LANGUAGE);
|
||||
},
|
||||
setLanguage: async (lng: string) => {
|
||||
await secureStorage.setItem(AppStorageKey.LANGUAGE, lng);
|
||||
await appStorage.setItem(AppStorageKey.LANGUAGE, lng);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user