minor refactor

This commit is contained in:
ammarahm-ed
2020-05-10 22:21:31 +05:00
parent 0d0f4cddbe
commit dab42a2e35
2 changed files with 16 additions and 11 deletions

View File

@@ -90,14 +90,14 @@ export const ActionSheetComponent = ({
if (tag.includes(',')) {
tag = tag.replace(',', '');
}
tagsInputRef.current?.setNativeProps({
text: '',
});
await db.notes.note(note.id).tag(tag);
setNote({...db.notes.note(note.id).data});
dispatch({type: ACTIONS.TAGS});
tagsInputRef.current?.setNativeProps({
text: '',
});
tagToAdd = '';
};
@@ -351,7 +351,6 @@ export const ActionSheetComponent = ({
.catch(async e => {
switch (e.message) {
case db.vault.ERRORS.noVault:
close('novault');
break;
case db.vault.ERRORS.vaultLocked:

View File

@@ -12,13 +12,17 @@ import Signup from '../../views/Signup';
import {updateEvent} from '../DialogManager/recievers';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import Container from '../Container';
const Stack = createStackNavigator();
const modalNavigatorRef2 = createRef();
const ModalNavigator = ({onStateChange}) => {
return (
<NavigationContainer onStateChange={onStateChange} independent={true} ref={modalNavigatorRef2}>
<NavigationContainer
onStateChange={onStateChange}
independent={true}
ref={modalNavigatorRef2}>
<Stack.Navigator
initialRouteName="Login"
screenOptions={{
@@ -127,11 +131,13 @@ class LoginDialog extends React.Component {
paddingVertical: 16,
zIndex: 10,
}}>
<Container>
<ModalNavigator
onStateChange={event => {
this.routeIndex = event.index;
}}
/>
</Container>
</View>
</Animatable.View>
</Modal>