Merge pull request #627 from matrix-org/matthew/fix-theme-npe

Matthew/fix theme npe
This commit is contained in:
Matthew Hodgson 2017-01-18 22:11:07 +00:00 committed by GitHub
commit 128db1a679
2 changed files with 11 additions and 8 deletions

View file

@ -588,13 +588,6 @@ module.exports = React.createClass({
_onLoadCompleted: function() {
this.props.onLoadCompleted();
this.setState({loading: false});
// set up the right theme.
// XXX: this will temporarily flicker the wrong CSS.
dis.dispatch({
action: 'set_theme',
value: UserSettingsStore.getSyncedSetting('theme')
});
},
/**
@ -730,6 +723,16 @@ module.exports = React.createClass({
action: 'logout'
});
});
cli.on("accountData", function(ev) {
if (ev.getType() === 'im.vector.web.settings') {
if (ev.getContent() && ev.getContent().theme) {
dis.dispatch({
action: 'set_theme',
value: ev.getContent().theme,
});
}
}
});
},
onFocus: function(ev) {

View file

@ -605,7 +605,7 @@ module.exports = React.createClass({
<label htmlFor={id}>{this.nameForMedium(val.medium)}</label>
</div>
<div className="mx_UserSettings_profileInputCell">
<input key={val.address} id={id} value={val.address} disabled />
<input type="text" key={val.address} id={id} value={val.address} disabled />
</div>
<div className="mx_UserSettings_threepidButton">
<img src="img/icon_context_delete.svg" width="14" height="14" alt="Remove" onClick={this.onRemoveThreepidClicked.bind(this, val)} />