fix vault dialog not opening on ios

This commit is contained in:
ammarahm-ed
2020-04-18 13:49:24 +05:00
parent 6f3c4b5c38
commit 6f416b2e07
2 changed files with 187 additions and 205 deletions

View File

@@ -336,15 +336,14 @@ export const ActionSheetComponent = ({
if (!note.id) return; if (!note.id) return;
if (note.locked) { if (note.locked) {
close(); close('unlock');
openVault(note, true, true, true, false, false);
return; return;
} else { } else {
db.vault db.vault
.add(note.id) .add(note.id)
.then(() => { .then(() => {
dispatch({ type: ACTIONS.NOTES }) dispatch({type: ACTIONS.NOTES});
eSendEvent(refreshNotesPage); eSendEvent(refreshNotesPage);
dispatch({type: ACTIONS.PINNED}); dispatch({type: ACTIONS.PINNED});
close(); close();
@@ -352,12 +351,10 @@ export const ActionSheetComponent = ({
.catch(async e => { .catch(async e => {
switch (e.message) { switch (e.message) {
case db.vault.ERRORS.noVault: case db.vault.ERRORS.noVault:
openVault(note, false); close('novault');
close();
break; break;
case db.vault.ERRORS.vaultLocked: case db.vault.ERRORS.vaultLocked:
openVault(note, true, true); close('valutlocked');
close();
break; break;
case db.vault.ERRORS.wrongPassword: case db.vault.ERRORS.wrongPassword:
close(); close();
@@ -809,7 +806,8 @@ export const ActionSheetComponent = ({
position: 'absolute', position: 'absolute',
width: '100%', width: '100%',
height: '100%', height: '100%',
}}></TouchableOpacity> }}
/>
{note && note.tags ? note.tags.map(_renderTag) : null} {note && note.tags ? note.tags.map(_renderTag) : null}
<TextInput <TextInput
style={{ style={{

View File

@@ -210,31 +210,15 @@ export class DialogManager extends Component {
this._showSimpleDialog(TEMPLATE_PERMANANT_DELETE); this._showSimpleDialog(TEMPLATE_PERMANANT_DELETE);
break; break;
} }
case 'lock': {
this._showVaultDialog();
break;
}
case 'novault': { case 'novault': {
this.setState({ openVault(this.state.item, false);
vaultExists: false, }
}); case 'vaultlocked': {
this._showVaultDialog(); openVault(this.state.item, true, true);
break;
} }
case 'unlock': { case 'unlock': {
this.setState({ openVault(this.state.item, true, true, true, false, false);
isPerm: true,
});
this._showVaultDialog();
break;
}
case 'unlock_share': {
this.setState({
isPerm: false,
shareAfterUnlock: true,
});
this._showVaultDialog();
break;
} }
case 'notebook': { case 'notebook': {
this.showAddNotebook({item: this.state.item}); this.showAddNotebook({item: this.state.item});