Loading me() when appropriate, fixes Spotify not authorized profile

This commit is contained in:
James Barnsley
2018-11-01 16:33:19 +13:00
parent 0eb3e3f81c
commit 25393e0116
5 changed files with 27 additions and 23 deletions

View File

@ -19783,16 +19783,18 @@ var Parallax = function (_React$Component) {
url: null
});
var self = this;
var imageObject = new Image();
imageObject.src = url;
if (url && url !== "") {
var self = this;
var imageObject = new Image();
imageObject.src = url;
imageObject.onload = function () {
self.setState({
loaded: true,
url: url
});
};
imageObject.onload = function () {
self.setState({
loaded: true,
url: url
});
};
}
}
}, {
key: "render",
@ -75774,13 +75776,13 @@ var Services = function (_React$Component) {
_createClass(Services, [{
key: 'componentDidMount',
value: function componentDidMount() {
if (this.props.spotify.me && this.props.core.users[this.props.spotify.me.id] === undefined) {
if ((this.props.spotify.enabled || this.props.spotify.authorization) && (!this.props.spotify.me || this.props.core.users[this.props.spotify.me.id] === undefined)) {
this.props.spotifyActions.getMe();
}
if (this.props.lastfm.authorization && this.props.core.users["lastfm:user:" + this.props.lastfm.authorization.name] === undefined) {
this.props.lastfmActions.getMe();
}
if (this.props.genius.me && this.props.core.users["genius:user:" + this.props.genius.me.id] === undefined) {
if (this.props.genius.authorization && (!this.props.genius.me || this.props.core.users["genius:user:" + this.props.genius.me.id] === undefined)) {
this.props.geniusActions.getMe();
}
}