From f92c2cd5741da0f1b9d63532695b74e59cb4e21c Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 31 Jan 2022 17:42:26 +0800 Subject: [PATCH] FIX: Wizard id increment fix (#177) * increment object ids based on last object id * Bump version * Apply prettier --- assets/javascripts/discourse/components/wizard-links.js.es6 | 3 ++- plugin.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/wizard-links.js.es6 b/assets/javascripts/discourse/components/wizard-links.js.es6 index 50dadfe6..62c45911 100644 --- a/assets/javascripts/discourse/components/wizard-links.js.es6 +++ b/assets/javascripts/discourse/components/wizard-links.js.es6 @@ -81,7 +81,8 @@ export default Component.extend({ let index = 0; if (items.length) { - index = items.length; + let last_item = items[items.length - 1]; + index = Number(last_item.id.split("_").pop()); } params.index = index; diff --git a/plugin.rb b/plugin.rb index a0094420..90376489 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Create custom wizards -# version: 1.17.0 +# version: 1.17.1 # authors: Angus McLeod # url: https://github.com/paviliondev/discourse-custom-wizard # contact emails: angus@thepavilion.io