diff --git a/src/skins/vector/views/atoms/RoomAvatar.js b/src/skins/vector/views/atoms/RoomAvatar.js
index 39b995a7a5..3d3463e272 100644
--- a/src/skins/vector/views/atoms/RoomAvatar.js
+++ b/src/skins/vector/views/atoms/RoomAvatar.js
@@ -43,9 +43,13 @@ module.exports = React.createClass({
},
render: function() {
+ var style = {
+ 'max-width': this.props.width,
+ 'max-height': this.props.height,
+ };
return (
);
}
diff --git a/src/skins/vector/views/molecules/ChangeAvatar.js b/src/skins/vector/views/molecules/ChangeAvatar.js
index 52a59e3f8b..ec10e4bf9b 100644
--- a/src/skins/vector/views/molecules/ChangeAvatar.js
+++ b/src/skins/vector/views/molecules/ChangeAvatar.js
@@ -18,6 +18,7 @@ limitations under the License.
var React = require('react');
+var sdk = require('matrix-react-sdk')
var ChangeAvatarController = require('matrix-react-sdk/lib/controllers/molecules/ChangeAvatar')
var Loader = require("react-loader");
@@ -28,6 +29,7 @@ module.exports = React.createClass({
mixins: [ChangeAvatarController],
onFileSelected: function(ev) {
+ this.avatarSet = true;
this.setAvatarFromFile(ev.target.files[0]);
},
@@ -38,13 +40,23 @@ module.exports = React.createClass({
},
render: function() {
+ var RoomAvatar = sdk.getComponent('atoms.RoomAvatar');
+ var avatarImg;
+ // Having just set an avatar we just display that since it will take a little
+ // time to propagate through to the RoomAvatar.
+ if (this.props.room && !this.avatarSet) {
+ avatarImg =