Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Fix #199
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Jul 15, 2018
1 parent bd2619c commit 14bb67d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/js/pages/Welcome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ class Welcome extends Component {
renderFavorite(favorite = {}) {
var { classes, controller } = this.props;

if (favorite.size === 0) {
return false;
}

return (
<Link
className={classes.clearfix}
Expand Down
7 changes: 5 additions & 2 deletions src/js/stores/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ class Home {
// Save the songs of red heart
me.rocking(favorite);

if (recommend.length) {
if (favorite.size) {
controller.setup(favorite);
} else if (recommend.size) {
// Play the recommend songs
controller.setup(recommend);
} else {
controller.setup(favorite);
// Some user no favorite and recommend, set a fallback playlist
controller.setup(res.data.list[2]);
}
} else {
res = await axios.get(`/api/home`);
Expand Down

0 comments on commit 14bb67d

Please sign in to comment.