Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix pin and unpin from notifications

Ammar Ahmed75cb2fe1949f
diff --git a/apps/mobile/app/hooks/use-actions.tsx b/apps/mobile/app/hooks/use-actions.tsx
index 58f78bb58..defd937a4 100644
--- a/apps/mobile/app/hooks/use-actions.tsx
+++ b/apps/mobile/app/hooks/use-actions.tsx
@@ -680,7 +680,8 @@ export const useActions = ({
async function pinToNotifications() {
if (notifPinned) {
- Notifications.remove(item.id);
+ await Notifications.remove(item.id);
+ await sleep(500);
await Notifications.get();
setNotifPinned(isNotePinnedInNotifications(item));
return;
@@ -694,7 +695,8 @@ export const useActions = ({
return;
}
- Notifications.pinNote(item.id);
+ await Notifications.pinNote(item.id);
+ await sleep(500);
await Notifications.get();
setNotifPinned(isNotePinnedInNotifications(item));
}