Hide duplicates when refreshing token
This commit is contained in:
parent
09e9c3ff98
commit
80f4369e7b
1 changed files with 22 additions and 9 deletions
|
@ -88,14 +88,21 @@ var DuplicateFinderBox = React.createClass({
|
||||||
currentId: null,
|
currentId: null,
|
||||||
currentUId: null,
|
currentUId: null,
|
||||||
dups: null,
|
dups: null,
|
||||||
dupsLoading: false
|
dupsLoading: false,
|
||||||
|
clicked: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
componentWillReceiveProps: function (nextProps) {
|
||||||
|
this.setState({
|
||||||
|
clicked: false
|
||||||
|
});
|
||||||
|
},
|
||||||
handlePlaylistClick: function (id, uid) {
|
handlePlaylistClick: function (id, uid) {
|
||||||
this.setState({
|
this.setState({
|
||||||
currentId: id,
|
currentId: id,
|
||||||
currentUId: uid,
|
currentUId: uid,
|
||||||
dupsLoading: true
|
dupsLoading: true,
|
||||||
|
clicked: true
|
||||||
});
|
});
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
@ -117,10 +124,19 @@ var DuplicateFinderBox = React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
var duplicates = <p>Loading...</p>;
|
var duplicates;
|
||||||
|
if (this.state.clicked) {
|
||||||
|
duplicates = <p>Loading...</p>;
|
||||||
if (!this.state.dupsLoading) {
|
if (!this.state.dupsLoading) {
|
||||||
duplicates = <DuplicatesBox dups={this.state.dups}/>;
|
duplicates = <DuplicatesBox dups={this.state.dups}/>;
|
||||||
}
|
}
|
||||||
|
duplicates = (
|
||||||
|
<div className="col-md-6">
|
||||||
|
<h2>Duplicates</h2>
|
||||||
|
{duplicates}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
var playlistBox = <p>Loading...</p>;
|
var playlistBox = <p>Loading...</p>;
|
||||||
if (!this.props.playlistsLoading) {
|
if (!this.props.playlistsLoading) {
|
||||||
playlistBox = <PlaylistBox handleClick={this.handlePlaylistClick} playlists={this.props.playlists}/>;
|
playlistBox = <PlaylistBox handleClick={this.handlePlaylistClick} playlists={this.props.playlists}/>;
|
||||||
|
@ -131,11 +147,8 @@ var DuplicateFinderBox = React.createClass({
|
||||||
<h2>Playlists</h2>
|
<h2>Playlists</h2>
|
||||||
{playlistBox}
|
{playlistBox}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-md-6">
|
|
||||||
<h2>Duplicates</h2>
|
|
||||||
{duplicates}
|
{duplicates}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue