1
1
/*
2
- Copyright 2024 New Vector Ltd.
2
+ Copyright 2024-2025 New Vector Ltd.
3
3
Copyright 2019-2021 The Matrix.org Foundation C.I.C.
4
4
5
5
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> {
330
330
} ) ;
331
331
} ;
332
332
333
+ private onInputCancel = ( ) : void => this . setState ( ( s ) => ( { idServer : s . currentClientIdServer ?? "" } ) ) ;
334
+ private onClearServerErrors = ( ) : void => this . setState ( { error : undefined } ) ;
335
+
333
336
public render ( ) : React . ReactNode {
334
337
const idServerUrl = this . state . currentClientIdServer ;
335
338
let sectionTitle ;
@@ -339,13 +342,13 @@ export default class SetIdServer extends React.Component<IProps, IState> {
339
342
bodyText = _t (
340
343
"identity_server|description_connected" ,
341
344
{ } ,
342
- { server : ( sub ) => < strong > { abbreviateUrl ( idServerUrl ) } </ strong > } ,
345
+ { server : ( ) => < strong > { abbreviateUrl ( idServerUrl ) } </ strong > } ,
343
346
) ;
344
347
if ( this . props . missingTerms ) {
345
348
bodyText = _t (
346
349
"identity_server|change_server_prompt" ,
347
350
{ } ,
348
- { server : ( sub ) => < strong > { abbreviateUrl ( idServerUrl ) } </ strong > } ,
351
+ { server : ( ) => < strong > { abbreviateUrl ( idServerUrl ) } </ strong > } ,
349
352
) ;
350
353
}
351
354
} else {
@@ -381,9 +384,9 @@ export default class SetIdServer extends React.Component<IProps, IState> {
381
384
cancelButtonLabel = { _t ( "action|reset" ) }
382
385
disabled = { ! ! this . state . busy }
383
386
label = { _t ( "identity_server|url_field_label" ) }
384
- onCancel = { ( ) => this . setState ( ( s ) => ( { idServer : s . currentClientIdServer ?? "" } ) ) }
387
+ onCancel = { this . onInputCancel }
385
388
onChange = { this . onIdentityServerChanged }
386
- onClearServerErrors = { ( ) => this . setState ( { error : undefined } ) }
389
+ onClearServerErrors = { this . onClearServerErrors }
387
390
onSave = { this . checkIdServer }
388
391
placeholder = { this . state . defaultIdServer }
389
392
saveButtonLabel = { _t ( "action|change" ) }
0 commit comments