We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd43cdd commit 0b6ba86Copy full SHA for 0b6ba86
assets/javascripts/discourse/components/wizard-links.js.es6
@@ -78,16 +78,9 @@ export default Component.extend({
78
let params = setWizardDefaults({}, itemType);
79
80
params.isNew = true;
81
+ params.index = items.length;
82
- let index = 0;
83
- if (items.length) {
84
- let last_item = items[items.length - 1];
85
- index = Number(last_item.id.split("_").pop());
86
- }
87
-
88
- params.index = index;
89
90
- let id = `${itemType}_${index + 1}`;
+ let id = `${itemType}_${params.index + 1}`;
91
if (itemType === "field") {
92
id = `${this.parentId}_${id}`;
93
}
0 commit comments