mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix notes not unpinned
This commit is contained in:
@@ -192,7 +192,6 @@ export const ActionSheetComponent = ({
|
|||||||
name: 'Delete',
|
name: 'Delete',
|
||||||
icon: 'delete',
|
icon: 'delete',
|
||||||
func: async () => {
|
func: async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await deleteItems(note);
|
await deleteItems(note);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -285,7 +284,7 @@ export const ActionSheetComponent = ({
|
|||||||
func: async () => {
|
func: async () => {
|
||||||
if (!note.id) return;
|
if (!note.id) return;
|
||||||
if (note.type === 'note') {
|
if (note.type === 'note') {
|
||||||
if (db.notes.pinned.length === 3) {
|
if (db.notes.pinned.length === 3 && !note.pinned) {
|
||||||
ToastEvent.show(
|
ToastEvent.show(
|
||||||
'You cannot pin more than 3 notes',
|
'You cannot pin more than 3 notes',
|
||||||
'error',
|
'error',
|
||||||
@@ -295,7 +294,7 @@ export const ActionSheetComponent = ({
|
|||||||
}
|
}
|
||||||
await db.notes.note(note.id).pin();
|
await db.notes.note(note.id).pin();
|
||||||
} else {
|
} else {
|
||||||
if (db.notebooks.pinned.length === 3) {
|
if (db.notebooks.pinned.length === 3 && !note.pinned) {
|
||||||
ToastEvent.show(
|
ToastEvent.show(
|
||||||
'You cannot pin more than 3 notes',
|
'You cannot pin more than 3 notes',
|
||||||
'error',
|
'error',
|
||||||
@@ -520,7 +519,7 @@ export const ActionSheetComponent = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{!note.id && !note.dateCreated ? (
|
{!note.id && !note.dateCreated ? (
|
||||||
<Paragraph style={{marginVertical: 10,alignSelf:"center"}}>
|
<Paragraph style={{marginVertical: 10, alignSelf: 'center'}}>
|
||||||
Start writing to save your note.
|
Start writing to save your note.
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -110,13 +110,13 @@ const ActionStrip = ({note, setActionStrip}) => {
|
|||||||
if (!note.id) return;
|
if (!note.id) return;
|
||||||
|
|
||||||
if (note.type === 'note') {
|
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');
|
ToastEvent.show('You cannot pin more than 3 notes', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await db.notes.note(note.id).pin();
|
await db.notes.note(note.id).pin();
|
||||||
} else {
|
} 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');
|
ToastEvent.show('You cannot pin more than 3 notebooks', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user