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,
|
||||
currentUId: null,
|
||||
dups: null,
|
||||
dupsLoading: false
|
||||
dupsLoading: false,
|
||||
clicked: false
|
||||
};
|
||||
},
|
||||
componentWillReceiveProps: function (nextProps) {
|
||||
this.setState({
|
||||
clicked: false
|
||||
});
|
||||
},
|
||||
handlePlaylistClick: function (id, uid) {
|
||||
this.setState({
|
||||
currentId: id,
|
||||
currentUId: uid,
|
||||
dupsLoading: true
|
||||
dupsLoading: true,
|
||||
clicked: true
|
||||
});
|
||||
var self = this;
|
||||
|
||||
|
@ -117,9 +124,18 @@ var DuplicateFinderBox = React.createClass({
|
|||
});
|
||||
},
|
||||
render: function () {
|
||||
var duplicates = <p>Loading...</p>;
|
||||
if (!this.state.dupsLoading) {
|
||||
duplicates = <DuplicatesBox dups={this.state.dups}/>;
|
||||
var duplicates;
|
||||
if (this.state.clicked) {
|
||||
duplicates = <p>Loading...</p>;
|
||||
if (!this.state.dupsLoading) {
|
||||
duplicates = <DuplicatesBox dups={this.state.dups}/>;
|
||||
}
|
||||
duplicates = (
|
||||
<div className="col-md-6">
|
||||
<h2>Duplicates</h2>
|
||||
{duplicates}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
var playlistBox = <p>Loading...</p>;
|
||||
if (!this.props.playlistsLoading) {
|
||||
|
@ -131,10 +147,7 @@ var DuplicateFinderBox = React.createClass({
|
|||
<h2>Playlists</h2>
|
||||
{playlistBox}
|
||||
</div>
|
||||
<div className="col-md-6">
|
||||
<h2>Duplicates</h2>
|
||||
{duplicates}
|
||||
</div>
|
||||
{duplicates}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue