mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
do not allow deleting locked note directly
This commit is contained in:
@@ -39,7 +39,7 @@ import {
|
|||||||
import {deleteItems} from '../../utils/functions';
|
import {deleteItems} from '../../utils/functions';
|
||||||
import {MMKV} from '../../utils/mmkv';
|
import {MMKV} from '../../utils/mmkv';
|
||||||
import {opacity, pv, SIZE} from '../../utils/SizeUtils';
|
import {opacity, pv, SIZE} from '../../utils/SizeUtils';
|
||||||
import {timeConverter} from '../../utils/TimeUtils';
|
import {sleep, timeConverter} from '../../utils/TimeUtils';
|
||||||
import {PremiumTag} from '../Premium/PremiumTag';
|
import {PremiumTag} from '../Premium/PremiumTag';
|
||||||
import {PressableButton} from '../PressableButton';
|
import {PressableButton} from '../PressableButton';
|
||||||
import {Toast} from '../Toast';
|
import {Toast} from '../Toast';
|
||||||
@@ -176,10 +176,21 @@ export const ActionSheetComponent = ({
|
|||||||
name: 'Delete',
|
name: 'Delete',
|
||||||
icon: 'delete',
|
icon: 'delete',
|
||||||
func: async () => {
|
func: async () => {
|
||||||
try {
|
if (note.locked) {
|
||||||
await deleteItems(note);
|
close();
|
||||||
} catch (e) {
|
await sleep(300);
|
||||||
console.log(e);
|
openVault({
|
||||||
|
deleteNote: true,
|
||||||
|
novault: true,
|
||||||
|
locked: true,
|
||||||
|
item: note,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
await deleteItems(note);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
close();
|
close();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -676,8 +676,9 @@ export class VaultDialog extends Component {
|
|||||||
: 'Lock'
|
: 'Lock'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Toast context="local" />
|
|
||||||
</View>
|
</View>
|
||||||
|
<Toast context="local" />
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user