mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
partially fix note locking
This commit is contained in:
@@ -464,6 +464,12 @@ export class DialogManager extends Component {
|
||||
colors={colors}
|
||||
note={item}
|
||||
perm={isPerm}
|
||||
reset={() => {
|
||||
this.setState({
|
||||
isPerm: false,
|
||||
shareAfterUnlock: false,
|
||||
});
|
||||
}}
|
||||
shareAfterUnlock={shareAfterUnlock}
|
||||
openedToUnlock={false}
|
||||
visible={vaultDialog}
|
||||
|
||||
@@ -43,6 +43,7 @@ export class VaultDialog extends Component {
|
||||
this.setState({
|
||||
visible: false,
|
||||
});
|
||||
this.props.reset();
|
||||
};
|
||||
|
||||
onPress = async () => {
|
||||
|
||||
@@ -105,7 +105,7 @@ const Editor = ({navigation, noMenu}) => {
|
||||
};
|
||||
|
||||
const clearEditor = async () => {
|
||||
await saveNote();
|
||||
await saveNote(true);
|
||||
title = null;
|
||||
content = null;
|
||||
note = null;
|
||||
@@ -177,7 +177,6 @@ const Editor = ({navigation, noMenu}) => {
|
||||
},
|
||||
id: id,
|
||||
});
|
||||
console.log('here', title, id);
|
||||
if (id !== rId && !note?.locked) {
|
||||
id = rId;
|
||||
note = db.notes.note(id);
|
||||
@@ -191,13 +190,13 @@ const Editor = ({navigation, noMenu}) => {
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
if (id) {
|
||||
dispatch({
|
||||
type: ACTIONS.CURRENT_EDITING_NOTE,
|
||||
id: id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (content.text.length < 200 || saveCounter < 2) {
|
||||
dispatch({
|
||||
@@ -206,8 +205,10 @@ const Editor = ({navigation, noMenu}) => {
|
||||
}
|
||||
saveCounter++;
|
||||
if (id) {
|
||||
let lockednote = db.notes.note(id);
|
||||
let lockednote = db.notes.note(id).data;
|
||||
console.log(id, lockednote);
|
||||
if (lockNote && lockednote && lockednote.locked) {
|
||||
console.log('CRASH AFTER HERE');
|
||||
await db.notes.note(id).lock('password');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user