mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-03 12:41:45 +02:00
fix: You cannot pin more than 3 notes on unpin
This commit is contained in:
@@ -61,11 +61,11 @@ class NoteStore extends BaseStore {
|
||||
|
||||
pin = async (id) => {
|
||||
// TODO (hack) we probably shouldn't do this here.
|
||||
if (db.notes.pinned.length >= 3) {
|
||||
const note = db.notes.note(id);
|
||||
if (!note.data.pinned && db.notes.pinned.length >= 3) {
|
||||
await showToast("error", "You cannot pin more than 3 notes.");
|
||||
return;
|
||||
}
|
||||
const note = db.notes.note(id);
|
||||
if (!this._syncEditor(note.id, "pinned", !note.data.pinned)) {
|
||||
await note.pin();
|
||||
this.refresh();
|
||||
|
||||
Reference in New Issue
Block a user