Skip to content

Commit c0fca5f

Browse files
committed
Update copyright + use class methods.
1 parent f6e6290 commit c0fca5f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/components/views/settings/SetIdServer.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2024 New Vector Ltd.
2+
Copyright 2024-2025 New Vector Ltd.
33
Copyright 2019-2021 The Matrix.org Foundation C.I.C.
44
55
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
@@ -330,6 +330,9 @@ export default class SetIdServer extends React.Component<IProps, IState> {
330330
});
331331
};
332332

333+
private onInputCancel = (): void => this.setState((s) => ({ idServer: s.currentClientIdServer ?? "" }));
334+
private onClearServerErrors = (): void => this.setState({ error: undefined });
335+
333336
public render(): React.ReactNode {
334337
const idServerUrl = this.state.currentClientIdServer;
335338
let sectionTitle;
@@ -339,13 +342,13 @@ export default class SetIdServer extends React.Component<IProps, IState> {
339342
bodyText = _t(
340343
"identity_server|description_connected",
341344
{},
342-
{ server: (sub) => <strong>{abbreviateUrl(idServerUrl)}</strong> },
345+
{ server: () => <strong>{abbreviateUrl(idServerUrl)}</strong> },
343346
);
344347
if (this.props.missingTerms) {
345348
bodyText = _t(
346349
"identity_server|change_server_prompt",
347350
{},
348-
{ server: (sub) => <strong>{abbreviateUrl(idServerUrl)}</strong> },
351+
{ server: () => <strong>{abbreviateUrl(idServerUrl)}</strong> },
349352
);
350353
}
351354
} else {
@@ -381,9 +384,9 @@ export default class SetIdServer extends React.Component<IProps, IState> {
381384
cancelButtonLabel={_t("action|reset")}
382385
disabled={!!this.state.busy}
383386
label={_t("identity_server|url_field_label")}
384-
onCancel={() => this.setState((s) => ({ idServer: s.currentClientIdServer ?? "" }))}
387+
onCancel={this.onInputCancel}
385388
onChange={this.onIdentityServerChanged}
386-
onClearServerErrors={() => this.setState({ error: undefined })}
389+
onClearServerErrors={this.onClearServerErrors}
387390
onSave={this.checkIdServer}
388391
placeholder={this.state.defaultIdServer}
389392
saveButtonLabel={_t("action|change")}

0 commit comments

Comments
 (0)