diff --git a/src/Screens/PerfilSettings/perfilsettings.js b/src/Screens/PerfilSettings/perfilsettings.js index 6b67610..6ffefc8 100644 --- a/src/Screens/PerfilSettings/perfilsettings.js +++ b/src/Screens/PerfilSettings/perfilsettings.js @@ -33,8 +33,9 @@ export default class PerfilSettings extends Component { img: placeHolder[0], userName: "", eMail: "", - profileImageUrl: "", - disabled: true, + profileImageUrl: + "https://firebasestorage.googleapis.com/v0/b/unichat-35f13.appspot.com/o/profile-placeholder.png?alt=media&token=2cd02156-cb41-4142-8903-72abac4ddf3c", + disabled: false, uploading: false } this.user = firebase.auth().currentUser @@ -90,26 +91,20 @@ export default class PerfilSettings extends Component { uploadphotos = () => { const user = firebase.auth().currentUser const { img } = this.state - this.setState({ uploading: true }) + this.setState({ uploading: true, disabled: true }) firebase .storage() .ref(`profile_pics/${user.uid}`) .putFile(img.path) .on(firebase.storage.TaskEvent.STATE_CHANGED, snapshot => { - let state = {} - state = { - ...state - } if (snapshot.state === firebase.storage.TaskState.SUCCESS) { - state = { + this.setState({ disabled: false, uploading: false, profileImageUrl: snapshot.downloadURL - } + }) } - - this.setState(state) }) }