1
0
Fork 0

FIX: link index assignment edge cases

Dieser Commit ist enthalten in:
Angus McLeod 2022-10-19 18:07:19 +02:00
Ursprung 02255491d0
Commit 92b02ed7d9

Datei anzeigen

@ -76,9 +76,10 @@ export default Component.extend({
if (!items || items.length === 0) { if (!items || items.length === 0) {
return 0; return 0;
} }
const lastItem = items[items.length - 1]; const numbers = items
const lastNumber = lastItem.id.split("_").pop(); .map((i) => Number(i.id.split("_").pop()))
return Number(lastNumber); .sort((a, b) => a - b);
return numbers[numbers.length - 1];
}, },
actions: { actions: {