Skip to content

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

fix pin to notif not working when headline is null

ammarahm-ed50a0d23d4962
diff --git a/apps/mobile/src/utils/hooks/useActions.js b/apps/mobile/src/utils/hooks/useActions.js
index 7d4351996..1649dc647 100644
--- a/apps/mobile/src/utils/hooks/useActions.js
+++ b/apps/mobile/src/utils/hooks/useActions.js
@@ -145,7 +145,9 @@ export const useActions = ({ close = () => {}, item }) => {
}
async function pinToNotifications() {
+ console.log('pinToNotifications');
if (Platform.OS === 'ios') return;
+
if (notifPinned !== null) {
Notifications.remove(item.id, notifPinned.identifier);
await sleep(1000);
@@ -154,11 +156,13 @@ export const useActions = ({ close = () => {}, item }) => {
return;
}
if (item.locked) return;
+ let html = await db.notes.note(item.id).content();
+ let text = await toTXT(item);
Notifications.present({
title: item.title,
- message: item.headline,
- subtitle: item.headline,
- bigText: await toTXT(item, true),
+ message: item.headline || text,
+ subtitle: item.headline || text,
+ bigText: html,
ongoing: true,
actions: ['UNPIN'],
tag: item.id