refactor: replace secure storage with app storage across components and hooks

This commit is contained in:
Firman Ramdhani
2026-07-27 12:23:46 +07:00
parent ca0c57277a
commit 94fc29722c
8 changed files with 52 additions and 44 deletions
+4 -4
View File
@@ -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);
},
},
},