Browse Source

Clicking the wrench icon again closes the config form

JC Brand 6 years ago
parent
commit
3ad93b56b3
2 changed files with 15 additions and 6 deletions
  1. 6 2
      dist/converse.js
  2. 9 4
      src/converse-muc-views.js

+ 6 - 2
dist/converse.js

@@ -54727,8 +54727,12 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins
          *      case, auto-configure won't happen, regardless of
          *      the settings.
          */
-        this.showSpinner();
-        this.model.fetchRoomConfiguration().then(iq => this.renderConfigurationForm(iq)).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
+        if (!this.config_form || !u.isVisible(this.config_form.el)) {
+          this.showSpinner();
+          this.model.fetchRoomConfiguration().then(iq => this.renderConfigurationForm(iq)).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
+        } else {
+          this.closeForm();
+        }
       },
 
       checkForReservedNick() {

+ 9 - 4
src/converse-muc-views.js

@@ -1218,10 +1218,15 @@ converse.plugins.add('converse-muc-views', {
                  *      case, auto-configure won't happen, regardless of
                  *      the settings.
                  */
-                this.showSpinner();
-                this.model.fetchRoomConfiguration()
-                    .then(iq => this.renderConfigurationForm(iq))
-                    .catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
+
+                if (!this.config_form || !u.isVisible(this.config_form.el)) {
+                    this.showSpinner();
+                    this.model.fetchRoomConfiguration()
+                        .then(iq => this.renderConfigurationForm(iq))
+                        .catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
+                } else {
+                    this.closeForm();
+                }
             },
 
             checkForReservedNick () {