Add option to unset your own avatar
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
e5c8e3e7ad
commit
6e7f0d649b
2 changed files with 14 additions and 1 deletions
|
@ -423,6 +423,11 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onAvatarRemoveClick: function() {
|
||||||
|
MatrixClientPeg.get().setAvatarUrl(null);
|
||||||
|
this.setState({avatarUrl: null}); // the avatar update will complete async for us
|
||||||
|
},
|
||||||
|
|
||||||
onLogoutClicked: function(ev) {
|
onLogoutClicked: function(ev) {
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
Modal.createTrackedDialog('Logout E2E Export', '', QuestionDialog, {
|
Modal.createTrackedDialog('Logout E2E Export', '', QuestionDialog, {
|
||||||
|
@ -1318,7 +1323,11 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx_UserSettings_avatarPicker">
|
<div className="mx_UserSettings_avatarPicker">
|
||||||
<div onClick={this.onAvatarPickerClick}>
|
<div className="mx_UserSettings_avatarPicker_remove" onClick={this.onAvatarRemoveClick}>
|
||||||
|
<img src="img/cancel.svg" width="15"
|
||||||
|
alt={_t("Remove avatar")} title={_t("Remove avatar")} />
|
||||||
|
</div>
|
||||||
|
<div onClick={this.onAvatarPickerClick} className="mx_UserSettings_avatarPicker_imgContainer">
|
||||||
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
|
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
|
||||||
showUploadSection={false} className="mx_UserSettings_avatarPicker_img" />
|
showUploadSection={false} className="mx_UserSettings_avatarPicker_img" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -74,6 +74,10 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onRoomStateEvents: function(ev) {
|
onRoomStateEvents: function(ev) {
|
||||||
|
if (!this.props.room) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ev.getRoomId() !== this.props.room.roomId || ev.getType() !== 'm.room.avatar'
|
if (ev.getRoomId() !== this.props.room.roomId || ev.getType() !== 'm.room.avatar'
|
||||||
|| ev.getSender() !== MatrixClientPeg.get().getUserId()) {
|
|| ev.getSender() !== MatrixClientPeg.get().getUserId()) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue