Skip to content

Commit dec670a

Browse files
committed
FIX: ensure we have the right upload ID when navigating between steps
1 parent 294c35c commit dec670a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import DiscourseURL from "discourse/lib/url";
22
import { withPluginApi } from "discourse/lib/plugin-api";
33
import getUrl from "discourse-common/lib/get-url";
4+
import { observes } from "discourse-common/utils/decorators";
45

56
export default {
67
name: "custom-wizard-edits",
@@ -35,6 +36,16 @@ export default {
3536
},
3637
},
3738
});
39+
40+
api.modifyClass("component:uppy-image-uploader", {
41+
// Needed to ensure appEvents get registered when navigating between steps
42+
@observes("id")
43+
initOnStepChange() {
44+
if (/wizard-field|wizard-step/.test(this.id)) {
45+
this._initialize();
46+
}
47+
},
48+
});
3849
});
3950
},
4051
};

0 commit comments

Comments
 (0)