minor tweaks

This commit is contained in:
Reinaldo Neto 2023-06-12 11:38:57 -03:00
parent ce48ef06a4
commit 63b49abfab
3 changed files with 2 additions and 7 deletions

View File

@ -14,10 +14,6 @@ class UserPreferences {
this.mmkv = MMKV;
}
getMMKV() {
return this.mmkv;
}
getString<T = string>(key: string) {
try {
return (this.mmkv.getString(key) as T) ?? null;

View File

@ -6,16 +6,13 @@ export default () =>
(createStore: any) =>
(...args: any) => {
const store = createStore(...args);
let currentType: NetInfoStateType | undefined;
const handleInternetStateChange = (nextState: NetInfoState) => {
if (nextState.type !== currentType) {
store.dispatch(setInternetType(nextState.type));
currentType = nextState.type;
}
};
NetInfo.addEventListener(handleInternetStateChange);
return store;
};

View File

@ -65,6 +65,8 @@ const ListPicker = ({
onPress={() => showActionSheet({ options: getOptions() })}
right={() => (
<Text style={[styles.title, { color: colors.actionTintColor }]}>
{/* when picking an option the label should be Never
but when showing among the other settings the label should be Off */}
{option.label === 'Never' ? I18n.t('Off') : I18n.t(option.label)}
</Text>
)}