You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Add option to unset your own avatar
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user