mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-06-17 06:31:01 +00:00
auto-commit for ff01f44c-1f35-4867-bff3-f736a451f7ec
This commit is contained in:
@@ -37,8 +37,27 @@ export default function SettingsScreen({ navigation }: any) {
|
||||
useEffect(() => {
|
||||
checkBiometricAvailability();
|
||||
loadBiometricSetting();
|
||||
loadCurrentLanguage();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// Reload language when screen gains focus
|
||||
const unsubscribe = navigation.addListener('focus', () => {
|
||||
loadCurrentLanguage();
|
||||
});
|
||||
return unsubscribe;
|
||||
}, [navigation]);
|
||||
|
||||
const loadCurrentLanguage = async () => {
|
||||
try {
|
||||
const savedLang = await AsyncStorage.getItem('appLanguage');
|
||||
const langName = savedLang ? LANGUAGE_NAMES[savedLang] || 'English' : 'English';
|
||||
setCurrentLanguage(langName);
|
||||
} catch (error) {
|
||||
console.error('Error loading language:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const checkBiometricAvailability = async () => {
|
||||
const compatible = await LocalAuthentication.hasHardwareAsync();
|
||||
const enrolled = await LocalAuthentication.isEnrolledAsync();
|
||||
|
||||
Reference in New Issue
Block a user