fix notes not unpinned

This commit is contained in:
ammarahm-ed
2020-12-31 12:04:00 +05:00
parent 6d78b0521a
commit 94c01afd68
2 changed files with 5 additions and 6 deletions

View File

@@ -110,13 +110,13 @@ const ActionStrip = ({note, setActionStrip}) => {
if (!note.id) return;
if (note.type === 'note') {
if (db.notes.pinned.length === 3) {
if (db.notes.pinned.length === 3 && !note.pinned) {
ToastEvent.show('You cannot pin more than 3 notes', 'error');
return;
}
await db.notes.note(note.id).pin();
} else {
if (db.notebooks.pinned.length === 3) {
if (db.notebooks.pinned.length === 3 && !note.pinned) {
ToastEvent.show('You cannot pin more than 3 notebooks', 'error');
return;
}