Resolved some minor issues
authorAlexander Ebert <ebert@woltlab.com>
Sun, 29 Nov 2020 19:46:18 +0000 (20:46 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 29 Nov 2020 19:46:18 +0000 (20:46 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts

index e409109567ce6f7ff7e6bf4cf6078adb62a55259..a2c0ed65003c3fbb36700d0a9b4af475d4a1618f 100644 (file)
@@ -27,10 +27,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Dom/Util", "..
             if (methods.length === 0) {
                 return;
             }
-            if (smtpCheckbox) {
-                this.onChange(smtpCheckbox);
-            }
-            this.container = document.createElement("div");
+            this.container = document.createElement("dl");
             this.container.innerHTML = `<dt>${Language.get("wcf.acp.email.smtp.test")}</dt>
 <dd>
   <a href="#" class="button">${Language.get("wcf.acp.email.smtp.test.run")}</a>
@@ -38,6 +35,9 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Dom/Util", "..
 </dd>`;
             this.buttonRunTest = this.container.querySelector("a");
             this.buttonRunTest.addEventListener("click", (ev) => this.onClick(ev));
+            if (smtpCheckbox) {
+                this.onChange(smtpCheckbox);
+            }
         }
         onChange(checkbox) {
             if (checkbox.value === "smtp" && checkbox.checked) {
index 3d5969d868d052e9c805d505896588497c58423c..8818a052d885d2bc86aa65ff366f68a85cbabf07 100644 (file)
@@ -81,7 +81,7 @@ define(["require", "exports", "tslib", "../../../Ajax/Request", "../../../Langua
                 });
             });
             const results = await Promise.all(tests.map((test) => test.catch((result) => result)));
-            const passed = results.some((result) => !result.pass);
+            const passed = !results.some((result) => !result.pass);
             // Delay the status update to prevent UI flicker.
             await new Promise((resolve) => window.setTimeout(resolve, 500));
             if (passed) {
index d6e9ecefed0cd245f45a4f428d6a6f12f8b2c4c4..9be7ad96bf379cf51eaa0ab2b4c2676cd21d4d87 100644 (file)
@@ -39,11 +39,7 @@ class EmailSmtpTest implements AjaxCallbackObject {
       return;
     }
 
-    if (smtpCheckbox) {
-      this.onChange(smtpCheckbox);
-    }
-
-    this.container = document.createElement("div");
+    this.container = document.createElement("dl");
     this.container.innerHTML = `<dt>${Language.get("wcf.acp.email.smtp.test")}</dt>
 <dd>
   <a href="#" class="button">${Language.get("wcf.acp.email.smtp.test.run")}</a>
@@ -52,6 +48,10 @@ class EmailSmtpTest implements AjaxCallbackObject {
 
     this.buttonRunTest = this.container.querySelector("a")!;
     this.buttonRunTest.addEventListener("click", (ev) => this.onClick(ev));
+
+    if (smtpCheckbox) {
+      this.onChange(smtpCheckbox);
+    }
   }
 
   private onChange(checkbox: HTMLInputElement): void {
index 15eab7bab9cf0135a3767ef15ef890710feb489b..57b981993f9488b8088ddfdedbd9bb87def50a82 100644 (file)
@@ -103,7 +103,7 @@ class RewriteTest {
 
     const results: TestResult[] = await Promise.all(tests.map((test) => test.catch((result) => result)));
 
-    const passed = results.some((result) => !result.pass);
+    const passed = !results.some((result) => !result.pass);
 
     // Delay the status update to prevent UI flicker.
     await new Promise((resolve) => window.setTimeout(resolve, 500));