DEV: Allow disabling composer submit (#17062)
…without overriding the computed property. Will fix warnings in discourse-perspective-api plugin.
This commit is contained in:
parent
e9a77e7f19
commit
8d0c2cd4f8
|
@ -120,6 +120,25 @@ export default Controller.extend({
|
|||
this.set("showPreview", val === "true");
|
||||
},
|
||||
|
||||
@computed(
|
||||
"model.loading",
|
||||
"isUploading",
|
||||
"isProcessingUpload",
|
||||
"_disableSubmit"
|
||||
)
|
||||
get disableSubmit() {
|
||||
return (
|
||||
this.model?.loading ||
|
||||
this.isUploading ||
|
||||
this.isProcessingUpload ||
|
||||
this._disableSubmit
|
||||
);
|
||||
},
|
||||
|
||||
set disableSubmit(value) {
|
||||
this.set("_disableSubmit", value);
|
||||
},
|
||||
|
||||
@discourseComputed("showPreview")
|
||||
toggleText(showPreview) {
|
||||
return showPreview
|
||||
|
@ -803,8 +822,6 @@ export default Controller.extend({
|
|||
},
|
||||
},
|
||||
|
||||
disableSubmit: or("model.loading", "isUploading", "isProcessingUpload"),
|
||||
|
||||
save(force, options = {}) {
|
||||
if (this.disableSubmit) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue