Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
FIX: Ensure we always progress index
Dieser Commit ist enthalten in:
Ursprung
cd43cdd29b
Commit
0b6ba868ce
1 geänderte Dateien mit 2 neuen und 9 gelöschten Zeilen
|
@ -78,16 +78,9 @@ export default Component.extend({
|
||||||
let params = setWizardDefaults({}, itemType);
|
let params = setWizardDefaults({}, itemType);
|
||||||
|
|
||||||
params.isNew = true;
|
params.isNew = true;
|
||||||
|
params.index = items.length;
|
||||||
|
|
||||||
let index = 0;
|
let id = `${itemType}_${params.index + 1}`;
|
||||||
if (items.length) {
|
|
||||||
let last_item = items[items.length - 1];
|
|
||||||
index = Number(last_item.id.split("_").pop());
|
|
||||||
}
|
|
||||||
|
|
||||||
params.index = index;
|
|
||||||
|
|
||||||
let id = `${itemType}_${index + 1}`;
|
|
||||||
if (itemType === "field") {
|
if (itemType === "field") {
|
||||||
id = `${this.parentId}_${id}`;
|
id = `${this.parentId}_${id}`;
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren