Explode ServerInfoForm class to a function.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-02 12:33:01 -07:00
parent 7b3d40ca1e
commit 6ca4d77b8f
2 changed files with 56 additions and 96 deletions

View File

@@ -7,7 +7,7 @@ import * as DomainUtil from "../../utils/domain-util";
import {reloadApp} from "./base-section";
import {initFindAccounts} from "./find-accounts";
import ServerInfoForm from "./server-info-form";
import {initServerInfoForm} from "./server-info-form";
interface ConnectedOrgSectionProps {
$root: Element;
@@ -69,12 +69,12 @@ export default class ConnectedOrgSection {
servers.length === 0 ? noServerText : "";
for (const [i, server] of servers.entries()) {
new ServerInfoForm({
initServerInfoForm({
$root: this.$serverInfoContainer,
server,
index: i,
onChange: reloadApp,
}).init();
});
}
this.$newOrgButton.addEventListener("click", () => {