修复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

@ -12,6 +12,12 @@ export default class UserIcon extends Component {
}; };
} }
static getDerivedStateFromProps(nextProps, prevState) {
return {
iconUrl: nextProps.iconUrl
};
}
_defaultOnPress() { _defaultOnPress() {
// empty // empty
} }

View file

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