mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix vault dialog not opening on ios
This commit is contained in:
@@ -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={{
|
||||||
|
|||||||
@@ -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});
|
||||||
|
|||||||
Reference in New Issue
Block a user