Skip to content

Commit

Permalink
Fix search screen, change header link to library
Browse files Browse the repository at this point in the history
  • Loading branch information
benkaiser committed Jul 10, 2022
1 parent a21a6dd commit e909962
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/views/mobile_header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class MobileHeader extends React.Component {
<Navbar collapseOnSelect fixedTop>
<Navbar.Header>
<Navbar.Brand>
<Link to='/' className='logoText'>Stretto</Link>
<Link to='/playlist/Library' className='logoText'>Stretto</Link>
</Navbar.Brand>
<Navbar.Toggle aria-controls='basic-nav' />
<FilterMenu navbar />
Expand Down
14 changes: 10 additions & 4 deletions src/js/views/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,23 @@ export default class Search extends PlaylistView {
}

songsText() {
const searchText = this.state.showLibrary ? 'Only showing library' : this.state.includesNotInLibrary ? 'Found more online' : 'Searching for more...';
const count = this._localPlaylist.songs.length;
return <p>{count} { count === 1 ? 'Song' : 'Songs' } in Library - {searchText}</p>;
if (this._localPlaylist) {
const searchText = this.state.showLibrary ? 'Only showing library' : this.state.includesNotInLibrary ? 'Found more online' : 'Searching for more...';
const count = this._localPlaylist.songs.length;
return <p>{count} { count === 1 ? 'Song' : 'Songs' } in Library - {searchText}</p>;
} else {
return '';
}
}

_showLibrary(showLibrary) {
this.setState({
showLibrary: showLibrary,
playlist: this._localPlaylist
}, () => {
if (!showLibrary) {
if (showLibrary) {
this._mounted && this.setState(this.determineStateForElementsToShow(0, window.innerHeight, this.state.playlist));
} else {
this._itunesSearch();
}
});
Expand Down

0 comments on commit e909962

Please sign in to comment.