fix: sync post translation state and clear feed cache on language change
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user