Skip to content

Commit d56526a

Browse files
committed
fix(title): pull in title from the node as well
1 parent 7a8bb14 commit d56526a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clients/web/src/common/api/derivers/item.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function deriveItemData({
199199
return {
200200
...item,
201201
authors: itemEnrichment?.authors || item?.authors || false,
202-
title: title({ item, itemEnrichment }),
202+
title: title({ item, itemEnrichment, node }),
203203
thumbnail: thumbnail({ item, itemEnrichment }),
204204
excerpt: excerpt({ item, itemEnrichment }),
205205
publisher: publisher({ item, itemEnrichment, passedPublisher }),
@@ -229,12 +229,13 @@ export function deriveItemData({
229229
* @param {object} curatedInfo Additional information provided by the curation team
230230
* @returns {string} The most appropriate title to show
231231
*/
232-
function title({ item, itemEnrichment }) {
232+
function title({ item, itemEnrichment, node }) {
233233
// This is for matching images/files
234234
const urlToUse = item?.collectionUrl || item?.givenUrl || item?.resolvedUrl
235235
const file = urlToUse?.substring(urlToUse.lastIndexOf('/') + 1)
236236
const fileName = file ? file.replace(/\.[^/.]+$/, '') : false
237237
return (
238+
node?.title ||
238239
itemEnrichment?.title ||
239240
item?.collection?.title ||
240241
item?.title ||

clients/web/src/common/api/queries/get-saved-items.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const getSavedItemsQuery = gql`
2626
favoritedAt
2727
isArchived
2828
archivedAt
29+
title
2930
tags {
3031
id
3132
name

0 commit comments

Comments
 (0)