mirror of https://github.com/vector-im/riot-web
				
				
				
			Merge pull request #3803 from matrix-org/t3chguy/fix_avatar_remove
Fix ability to remove avatarspull/21833/head
						commit
						4c40266938
					
				| 
						 | 
				
			
			@ -98,6 +98,8 @@ export default class RoomProfileSettings extends React.Component {
 | 
			
		|||
            newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
 | 
			
		||||
            newState.originalAvatarUrl = newState.avatarUrl;
 | 
			
		||||
            newState.avatarFile = null;
 | 
			
		||||
        } else if (this.state.originalAvatarUrl !== this.state.avatarUrl) {
 | 
			
		||||
            await client.sendStateEvent(this.props.roomId, 'm.room.avatar', {url: undefined}, '');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (this.state.originalTopic !== this.state.topic) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,6 +88,8 @@ export default class ProfileSettings extends React.Component {
 | 
			
		|||
            newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false);
 | 
			
		||||
            newState.originalAvatarUrl = newState.avatarUrl;
 | 
			
		||||
            newState.avatarFile = null;
 | 
			
		||||
        } else if (this.state.originalAvatarUrl !== this.state.avatarUrl) {
 | 
			
		||||
            await client.setAvatarUrl(""); // use empty string as Synapse 500s on undefined
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.setState(newState);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue