fix: sync post translation state and clear feed cache on language change

This commit is contained in:
Adolfo Reyna
2026-02-25 18:49:50 -05:00
parent c281878875
commit c508ea8fea
3 changed files with 14 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js';
import ProfileCardHorizontal from "../components/ProfileCardHorizontal.js";
import * as Updates from 'expo-updates';
import AsyncStorage from '@react-native-async-storage/async-storage';
let MenuView = ({ navigation }) => {
const [value, setValue] = React.useState(i18n.locale);
@@ -32,10 +32,11 @@ let MenuView = ({ navigation }) => {
}
}, []);
let changeLang = (locale) => {
let changeLang = async (locale) => {
i18n.locale = locale;
Moment.locale(locale);
setValue(locale);
await AsyncStorage.removeItem('feed');
//Change local on profile then reload
}
const languageOptions = [