Refactor validation

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-21 16:34:44 +03:00
parent b7dd1c77af
commit 3c303e0304
17 changed files with 256 additions and 151 deletions

View File

@@ -13,7 +13,11 @@ import { openDocumentTree } from 'react-native-scoped-storage';
import { useDispatch, useSelector } from 'react-redux';
import type {} from 'redux-thunk/extend-redux';
import styles from '../styles';
import { RootState, updateNoMedia, updateStorageUri } from '../state';
import {
RootState,
setNoMedia,
setStorageUri,
} from '../state';
import { useDimensions } from '../contexts';
const settingsScreenStyles = StyleSheet.create({
@@ -68,7 +72,7 @@ const SettingsScreen = () => {
}}
onPress={async () => {
const { uri } = await openDocumentTree(true);
void dispatch(updateStorageUri(uri));
void dispatch(setStorageUri(uri));
}}>
Change External Storage Path
</Button>
@@ -84,7 +88,7 @@ const SettingsScreen = () => {
<Switch
value={noMedia}
onValueChange={value => {
void dispatch(updateNoMedia(value));
void dispatch(setNoMedia(value));
}}
/>
</View>