allow pinning in free mode

This commit is contained in:
ammarahm-ed
2020-12-15 14:16:47 +05:00
parent dc155f4923
commit d63d52d322

View File

@@ -275,38 +275,29 @@ export const ActionSheetComponent = ({
name: 'Pin', name: 'Pin',
icon: 'tag-outline', icon: 'tag-outline',
func: async () => { func: async () => {
await PremiumService.verify( if (!note.id) return;
async () => { if (note.type === 'note') {
if (!note.id) return; if (db.notes.pinned.length === 3) {
if (note.type === 'note') { ToastEvent.show(
if (db.notes.pinned.length === 3) { 'You cannot pin more than 3 notes',
ToastEvent.show( 'error',
'You cannot pin more than 3 notes', 'local',
'error', );
'local', return;
); }
return; await db.notes.note(note.id).pin();
} } else {
await db.notes.note(note.id).pin(); if (db.notebooks.pinned.length === 3) {
} else { ToastEvent.show(
if (db.notebooks.pinned.length === 3) { 'You cannot pin more than 3 notes',
ToastEvent.show( 'error',
'You cannot pin more than 3 notes', 'local',
'error', );
'local', return;
); }
return; await db.notebooks.notebook(note.id).pin();
} }
await db.notebooks.notebook(note.id).pin(); localRefresh(item.type);
}
localRefresh(item.type);
},
{
context: 'sheet',
title: 'Get Notesnook Pro',
desc: 'To pin notes and notebooks become a Pro user today.',
},
);
}, },
close: false, close: false,
check: true, check: true,