mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix pin to notif not working when headline is null
This commit is contained in:
@@ -145,7 +145,9 @@ export const useActions = ({ close = () => {}, item }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function pinToNotifications() {
|
async function pinToNotifications() {
|
||||||
|
console.log('pinToNotifications');
|
||||||
if (Platform.OS === 'ios') return;
|
if (Platform.OS === 'ios') return;
|
||||||
|
|
||||||
if (notifPinned !== null) {
|
if (notifPinned !== null) {
|
||||||
Notifications.remove(item.id, notifPinned.identifier);
|
Notifications.remove(item.id, notifPinned.identifier);
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
@@ -154,11 +156,13 @@ export const useActions = ({ close = () => {}, item }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.locked) return;
|
if (item.locked) return;
|
||||||
|
let html = await db.notes.note(item.id).content();
|
||||||
|
let text = await toTXT(item);
|
||||||
Notifications.present({
|
Notifications.present({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
message: item.headline,
|
message: item.headline || text,
|
||||||
subtitle: item.headline,
|
subtitle: item.headline || text,
|
||||||
bigText: await toTXT(item, true),
|
bigText: html,
|
||||||
ongoing: true,
|
ongoing: true,
|
||||||
actions: ['UNPIN'],
|
actions: ['UNPIN'],
|
||||||
tag: item.id
|
tag: item.id
|
||||||
|
|||||||
Reference in New Issue
Block a user