Loader key including method
This commit is contained in:
@ -136,7 +136,7 @@ export class Album extends React.Component {
|
||||
if (!this.props.album) {
|
||||
if (
|
||||
helpers.isLoading(this.props.load_queue, [
|
||||
`spotify_albums/${helpers.getFromUri('albumid', this.props.uri)}`,
|
||||
`spotify_GET_albums/${helpers.getFromUri('albumid', this.props.uri)}`,
|
||||
])
|
||||
) {
|
||||
return <Loader body loading />;
|
||||
|
||||
@ -361,7 +361,7 @@ class Artist extends React.Component {
|
||||
const scheme = helpers.uriSource(this.props.uri);
|
||||
|
||||
if (!this.props.artist) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_artists/${helpers.getFromUri('artistid', this.props.uri)}`, 'lastfm_method=artist.getInfo'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_GET_artists/${helpers.getFromUri('artistid', this.props.uri)}`, 'lastfm_method=artist.getInfo'])) {
|
||||
return <Loader body loading />;
|
||||
}
|
||||
return (
|
||||
|
||||
@ -175,7 +175,7 @@ class Playlist extends React.Component {
|
||||
const playlist_id = helpers.getFromUri('playlistid', this.props.uri);
|
||||
|
||||
if (!this.props.playlist) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_playlists/${playlist_id}?`])) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_GET_playlists/${playlist_id}?`])) {
|
||||
return <Loader body loading />
|
||||
}
|
||||
return (
|
||||
|
||||
@ -6,16 +6,12 @@ import { bindActionCreators } from 'redux';
|
||||
import Link from '../components/Link';
|
||||
import ErrorMessage from '../components/ErrorMessage';
|
||||
import Header from '../components/Header';
|
||||
import TrackList from '../components/TrackList';
|
||||
import Thumbnail from '../components/Thumbnail';
|
||||
import LinksSentence from '../components/LinksSentence';
|
||||
import ArtistGrid from '../components/ArtistGrid';
|
||||
import FollowButton from '../components/Fields/FollowButton';
|
||||
import LastfmLoveButton from '../components/Fields/LastfmLoveButton';
|
||||
import Dater from '../components/Dater';
|
||||
import LazyLoadListener from '../components/LazyLoadListener';
|
||||
import SelectField from '../components/Fields/SelectField';
|
||||
import ContextMenuTrigger from '../components/ContextMenuTrigger';
|
||||
import URILink from '../components/URILink';
|
||||
import Icon from '../components/Icon';
|
||||
import Loader from '../components/Loader';
|
||||
|
||||
@ -117,15 +113,20 @@ class Track extends React.Component {
|
||||
}
|
||||
|
||||
renderLyricsSelector() {
|
||||
if (this.props.track.lyrics_results === undefined || this.props.track.lyrics_results === null) {
|
||||
const {
|
||||
track,
|
||||
geniusActions,
|
||||
} = this.props;
|
||||
|
||||
if (track.lyrics_results === undefined || track.lyrics_results === null) {
|
||||
return null;
|
||||
} if (this.props.track.lyrics_results.length <= 0) {
|
||||
} if (track.lyrics_results.length <= 0) {
|
||||
return (
|
||||
<div className="field lyrics-selector">
|
||||
<div className="input">
|
||||
<input type="text" disabled="disabled" value="No results" />
|
||||
<div className="description">
|
||||
Switch to another lyrics seach result
|
||||
Switch to another lyrics seach result
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -135,23 +136,18 @@ class Track extends React.Component {
|
||||
return (
|
||||
<div className="field lyrics-selector">
|
||||
<div className="input">
|
||||
<select
|
||||
onChange={(e) => this.props.geniusActions.getTrackLyrics(this.props.track.uri, e.target.value)}
|
||||
>
|
||||
{
|
||||
this.props.track.lyrics_results.map((result) => (
|
||||
<option
|
||||
key={result.path}
|
||||
value={result.path}
|
||||
defaultValue={result.path == this.props.track.lyrics_path}
|
||||
>
|
||||
{result.title}
|
||||
</option>
|
||||
))
|
||||
}
|
||||
</select>
|
||||
<SelectField
|
||||
onChange={(value) => geniusActions.getTrackLyrics(track.uri, value)}
|
||||
options={
|
||||
track.lyrics_results.map((result) => ({
|
||||
value: result.path,
|
||||
label: result.title,
|
||||
defaultValue: (result.path === track.lyrics_path),
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<div className="description">
|
||||
Switch to another lyrics seach result
|
||||
Switch to another lyrics seach result
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -170,7 +166,7 @@ class Track extends React.Component {
|
||||
<div className="lyrics">
|
||||
<div className="content" dangerouslySetInnerHTML={{ __html: this.props.track.lyrics }} />
|
||||
<div className="origin mid_grey-text">
|
||||
Origin:
|
||||
Origin:
|
||||
{' '}
|
||||
<a href={`https://genius.com${this.props.track.lyrics_path}`} target="_blank">{`https://genius.com${this.props.track.lyrics_path}`}</a>
|
||||
</div>
|
||||
@ -180,16 +176,14 @@ class Track extends React.Component {
|
||||
return (
|
||||
<ErrorMessage type="not-found" title="Not found">
|
||||
<p>
|
||||
Could not find track with URI "
|
||||
{encodeURIComponent(this.props.uri)}
|
||||
"
|
||||
Could not find track with URI "{encodeURIComponent(this.props.uri)}"
|
||||
</p>
|
||||
</ErrorMessage>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_track/${helpers.getFromUri('trackid', this.props.uri)}`])) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_GET_track/${helpers.getFromUri('trackid', this.props.uri)}`])) {
|
||||
return <Loader body loading />
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ class User extends React.Component {
|
||||
const user_id = helpers.getFromUri('userid', this.props.uri);
|
||||
|
||||
if (!this.props.user) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_users/${user_id}`, `spotify_users/${user_id}/playlists/?`])) {
|
||||
if (helpers.isLoading(this.props.load_queue, [`spotify_GET_users/${user_id}`, `spotify_GET_users/${user_id}/playlists/?`])) {
|
||||
return <Loader body loading />
|
||||
}
|
||||
return (
|
||||
|
||||
@ -28,7 +28,7 @@ class DiscoverCategories extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_browse/categories'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_GET_browse/categories'])) {
|
||||
return (
|
||||
<div className="view discover-categories-view">
|
||||
<Header icon="grid" title="Genre / Mood" />
|
||||
|
||||
@ -63,7 +63,7 @@ class DiscoverCategory extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_browse/categories/'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_GET_browse/categories/'])) {
|
||||
return (
|
||||
<div className="view discover-categories-view">
|
||||
<Header>
|
||||
|
||||
@ -58,7 +58,7 @@ class DiscoverFeatured extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_browse/featured-playlists'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_GET_browse/featured-playlists'])) {
|
||||
return (
|
||||
<div className="view discover-featured-view preserve-3d">
|
||||
<Header className="overlay" uiActions={this.props.uiActions}>
|
||||
|
||||
@ -70,7 +70,7 @@ class DiscoverNewReleases extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_browse/new-releases'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_GET_browse/new-releases'])) {
|
||||
return (
|
||||
<div className="view discover-new-releases-view">
|
||||
<Header>
|
||||
|
||||
@ -476,7 +476,7 @@ class Discover extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const is_loading = helpers.isLoading(this.props.load_queue, ['spotify_recommendations']);
|
||||
const is_loading = helpers.isLoading(this.props.load_queue, ['spotify_GET_recommendations']);
|
||||
const addable_tunabilities = [];
|
||||
for (const key in this.state.tunabilities) {
|
||||
if (this.state.tunabilities.hasOwnProperty(key)) {
|
||||
|
||||
@ -46,7 +46,7 @@ class LibraryTracks extends React.Component {
|
||||
|
||||
render() {
|
||||
// Note trailing "?" makes sure our context menu in_library checks doesn't interfere
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_me/tracks?'])) {
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_GET_me/tracks?'])) {
|
||||
return (
|
||||
<div className="view library-tracks-view">
|
||||
<Header icon="music" title="My tracks" />
|
||||
|
||||
Reference in New Issue
Block a user