diff --git a/public/script.js b/public/script.js index 0ec532e..f7c90b4 100644 --- a/public/script.js +++ b/public/script.js @@ -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 =

Loading...

; - if (!this.state.dupsLoading) { - duplicates = ; + var duplicates; + if (this.state.clicked) { + duplicates =

Loading...

; + if (!this.state.dupsLoading) { + duplicates = ; + } + duplicates = ( +
+

Duplicates

+ {duplicates} +
+ ) } var playlistBox =

Loading...

; if (!this.props.playlistsLoading) { @@ -131,10 +147,7 @@ var DuplicateFinderBox = React.createClass({

Playlists

{playlistBox} -
-

Duplicates

- {duplicates} -
+ {duplicates} ); }