Recsys: fix missing uuid

Ticket: 1745

## Issue
The search result (and the uuid) won't be ready when a recommendation is clicked, but a stub recsyst entry is created at this point. In the past, the uuid was randomly generated, so it didn't matter.

## Fix
Ensure the uuid field is filled when the recommendations are finally loaded.
This commit is contained in:
infinite-persistence 2022-06-24 14:02:40 +08:00
parent 4f47779303
commit 6b3e03cca4
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -93,6 +93,9 @@ const recsys: Recsys = {
if (!recsys.entries[claimId]) { if (!recsys.entries[claimId]) {
recsys.createRecsysEntry(claimId, null, uuid || recommendedMeta.uuid); recsys.createRecsysEntry(claimId, null, uuid || recommendedMeta.uuid);
} else if (!recsys.entries[claimId].uuid) {
// Stubs might not have the uuid ready at the time. Refill now.
recsys.entries[claimId].uuid = uuid || recommendedMeta.uuid;
} }
const claimIds = getClaimIdsFromUris(uris); const claimIds = getClaimIdsFromUris(uris);