Refactor validation
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user