MOBILE-3320 feedback: Fix some offline answers not loaded

main
Dani Palou 2021-06-16 16:14:04 +02:00
parent 88b0d3aa0a
commit da050a66c8
1 changed files with 2 additions and 1 deletions

View File

@ -172,11 +172,12 @@ export class AddonModFeedbackProvider {
return array.concat(responses); return array.concat(responses);
}, <OfflineResponsesArray> []).map((valueEntry) => { }, <OfflineResponsesArray> []).map((valueEntry) => {
const parts = valueEntry.id.split('_'); const parts = valueEntry.id.split('_');
const item = (parts[1] || '').replace(/\[.*\]/, ''); // Remove [0] and similar.
return { return {
...valueEntry, ...valueEntry,
typ: parts[0], typ: parts[0],
item: Number(parts[1]), item: Number(item),
}; };
}); });