From 879b1b7ead1269139ea0db271133e2add9857446 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sun, 22 Nov 2020 20:54:52 +1300 Subject: [PATCH] Adding feedback to LastFm love/unlove; Using selectors for love/follow buttons --- src/js/components/Fields/FollowButton.js | 37 ++++++----- src/js/components/Fields/LastfmLoveButton.js | 23 ++++--- src/js/services/lastfm/actions.js | 70 +++++++++++--------- src/js/services/spotify/actions.js | 6 +- 4 files changed, 74 insertions(+), 62 deletions(-) diff --git a/src/js/components/Fields/FollowButton.js b/src/js/components/Fields/FollowButton.js index 04e451cd..927e57ef 100755 --- a/src/js/components/Fields/FollowButton.js +++ b/src/js/components/Fields/FollowButton.js @@ -6,6 +6,7 @@ import * as spotifyActions from '../../services/spotify/actions'; import { isLoading, getFromUri } from '../../util/helpers'; import { i18n } from '../../locale'; import { Button } from '../Button'; +import { makeLoadingSelector } from '../../util/selectors'; class FollowButton extends React.Component { remove = () => { @@ -34,23 +35,16 @@ class FollowButton extends React.Component { removeText, spotify_authorized, is_following, - load_queue, + loading, } = this.props; if (!uri) return null; - const working = isLoading(load_queue, [ - 'spotify_me/tracks?', - 'spotify_me/albums?', - 'spotify_me/following?', - `spotify_playlists/${getFromUri('playlistid', uri)}/followers?`, - ]); - if (!spotify_authorized) { return (