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>
</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) {
});
});
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) {
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>
this.buttonRunTest = this.container.querySelector("a")!;
this.buttonRunTest.addEventListener("click", (ev) => this.onClick(ev));
+
+ if (smtpCheckbox) {
+ this.onChange(smtpCheckbox);
+ }
}
private onChange(checkbox: HTMLInputElement): void {
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));