@@ -206,20 +206,25 @@ export default class AliasSettings extends React.Component<IProps, IState> {
206
206
eventContent [ "alt_aliases" ] = altAliases ;
207
207
}
208
208
209
- this . context . sendStateEvent ( this . props . roomId , "m.room.canonical_alias" ,
210
- this . context . mxClient . sendStateEvent ( this . props . roomId , "m.room.canonical_alias" ,
211
- eventContent , "" ) . catch ( ( err ) => {
212
- logger . error ( err ) ;
213
- Modal . createTrackedDialog ( 'Error updating alternative addresses' , '' , ErrorDialog , {
214
- title : _t ( "Error updating main address" ) ,
215
- description : _t (
216
- "There was an error updating the room's alternative addresses. " +
209
+ this . context . sendStateEvent ( this . props . roomId , "m.room.canonical_alias" , eventContent , "" )
210
+ . then ( ( ) => {
211
+ this . setState ( {
212
+ altAliases,
213
+ } ) ;
214
+ } )
215
+ . catch ( ( err ) => {
216
+ // TODO: Add error handling based upon server validation
217
+ logger . error ( err ) ;
218
+ Modal . createTrackedDialog ( 'Error updating alternative addresses' , '' , ErrorDialog , {
219
+ title : _t ( "Error updating main address" ) ,
220
+ description : _t (
221
+ "There was an error updating the room's alternative addresses. " +
217
222
"It may not be allowed by the server or a temporary failure occurred." ,
218
- ) ,
223
+ ) ,
224
+ } ) ;
225
+ } ) . finally ( ( ) => {
226
+ this . setState ( { updatingCanonicalAlias : false } ) ;
219
227
} ) ;
220
- } ) . finally ( ( ) => {
221
- this . setState ( { updatingCanonicalAlias : false } ) ;
222
- } ) ;
223
228
}
224
229
225
230
private onNewAliasChanged = ( value : string ) => {
0 commit comments