minor tweaks
This commit is contained in:
parent
ce48ef06a4
commit
63b49abfab
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue