Handle case when action id does not have number at end
Dieser Commit ist enthalten in:
Ursprung
e06f543720
Commit
77923b443d
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
|
@ -77,9 +77,10 @@ export default Component.extend({
|
|||
let next = 1;
|
||||
|
||||
if (items.length) {
|
||||
next = Math.max.apply(Math, items.map((i) => {
|
||||
next = Math.max.apply(Math, items.map((i) => {
|
||||
let parts = i.id.split('_');
|
||||
return parts[parts.length - 1];
|
||||
let lastPart = parts[parts.length - 1];
|
||||
return isNaN(lastPart) ? 0 : lastPart;
|
||||
})) + 1;
|
||||
}
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren