0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 19:10:29 +01:00

Handle case when action id does not have number at end

Dieser Commit ist enthalten in:
Angus McLeod 2020-04-22 23:08:04 +10:00
Ursprung e06f543720
Commit 77923b443d

Datei anzeigen

@ -79,7 +79,8 @@ export default Component.extend({
if (items.length) { if (items.length) {
next = Math.max.apply(Math, items.map((i) => { next = Math.max.apply(Math, items.map((i) => {
let parts = i.id.split('_'); let parts = i.id.split('_');
return parts[parts.length - 1]; let lastPart = parts[parts.length - 1];
return isNaN(lastPart) ? 0 : lastPart;
})) + 1; })) + 1;
} }