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

wip - prevent step change during upload

Dieser Commit ist enthalten in:
merefield 2024-05-15 12:17:16 +01:00
Ursprung 0d0fb83bd1
Commit d4c5cb92ee
2 geänderte Dateien mit 18 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -4,22 +4,26 @@ import {
} from "discourse-common/utils/decorators"; } from "discourse-common/utils/decorators";
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import Component from "@ember/component"; import Component from "@ember/component";
import { inject as service } from "@ember/service";
export default Component.extend({ export default Component.extend({
showPreview: false, showPreview: false,
composer: service(),
classNameBindings: [ classNameBindings: [
":wizard-field-composer", ":wizard-field-composer",
"showPreview:show-preview:hide-preview", "showPreview:show-preview:hide-preview",
], ],
didInsertElement() { didInsertElement() {
this.set( debugger;
"composer", this.set("composer.reply", this.get("field.value") || "");
EmberObject.create({ // this.set(
loading: false, // "composer",
reply: this.get("field.value") || "", // EmberObject.create({
}) // loading: false,
); // reply: this.get("field.value") || "",
// })
// );
}, },
@observes("composer.reply") @observes("composer.reply")

Datei anzeigen

@ -9,8 +9,10 @@ import CustomWizard, {
} from "discourse/plugins/discourse-custom-wizard/discourse/models/custom-wizard"; } from "discourse/plugins/discourse-custom-wizard/discourse/models/custom-wizard";
import { alias, not } from "@ember/object/computed"; import { alias, not } from "@ember/object/computed";
import discourseLater from "discourse-common/lib/later"; import discourseLater from "discourse-common/lib/later";
import { inject as service } from "@ember/service";
export default Component.extend({ export default Component.extend({
composer: service(),
classNameBindings: [":wizard-step", "step.id"], classNameBindings: [":wizard-step", "step.id"],
saving: null, saving: null,
@ -182,7 +184,7 @@ export default Component.extend({
}, },
backStep() { backStep() {
if (this.saving) { if (this.saving || this.composer.isProcessingUpload) {
return; return;
} }
@ -190,7 +192,10 @@ export default Component.extend({
}, },
nextStep() { nextStep() {
if (this.saving) { console.log(this.composer.isProcessingUpload);
debugger;
if (this.saving || this.composer.isProcessingUpload) {
return; return;
} }