mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 18:34:42 +08:00
UX: prevent post submission when uploading
This commit is contained in:
@ -404,13 +404,15 @@ export default Ember.Controller.extend({
|
|||||||
disableSubmit: Ember.computed.or("model.loading", "isUploading"),
|
disableSubmit: Ember.computed.or("model.loading", "isUploading"),
|
||||||
|
|
||||||
save(force) {
|
save(force) {
|
||||||
const composer = this.get('model');
|
if (this.get("disableSubmit")) return;
|
||||||
|
|
||||||
// Clear the warning state if we're not showing the checkbox anymore
|
// Clear the warning state if we're not showing the checkbox anymore
|
||||||
if (!this.get('showWarning')) {
|
if (!this.get('showWarning')) {
|
||||||
this.set('model.isWarning', false);
|
this.set('model.isWarning', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const composer = this.get('model');
|
||||||
|
|
||||||
if (composer.get('cantSubmitPost')) {
|
if (composer.get('cantSubmitPost')) {
|
||||||
this.set('lastValidatedAt', Date.now());
|
this.set('lastValidatedAt', Date.now());
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user