修复bug: 用户头像上传不更新问题

This commit is contained in:
xuwenyang 2019-07-11 21:21:30 +08:00
parent 01991e9293
commit 4cf622c40d
2 changed files with 12 additions and 2 deletions

View file

@ -8,7 +8,13 @@ export default class UserIcon extends Component {
constructor(props) {
super(props);
this.state = {
iconUrl : props.iconUrl
iconUrl: props.iconUrl
};
}
static getDerivedStateFromProps(nextProps, prevState) {
return {
iconUrl: nextProps.iconUrl
};
}

View file

@ -241,12 +241,16 @@ export default class WritePage extends Component {
}
saveDiary() {
if(!this.state.content) {
return;
}
let photoUri = this.state.photoUri;
let topic = this.props.topic ? 1 : 0;
let waitingToast = Msg.showMsg('正在保存中', {
duration: 10000,
position: -150,
position: -75,
shadow: false,
hideOnPress: false
});