From 20939400dea60724660de957a90c83956ecc471f Mon Sep 17 00:00:00 2001 From: aj Date: Tue, 3 Sep 2019 19:01:43 +0100 Subject: [PATCH] added loading for playlist view --- src/js/Playlist/PlaylistView.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/Playlist/PlaylistView.js b/src/js/Playlist/PlaylistView.js index 5922aaa..408dddb 100644 --- a/src/js/Playlist/PlaylistView.js +++ b/src/js/Playlist/PlaylistView.js @@ -53,7 +53,9 @@ class PlaylistView extends Component{ shuffle: false, include_recommendations: false, add_this_month: false, - add_last_month: false + add_last_month: false, + + isLoading: true } this.handleAddPart = this.handleAddPart.bind(this); this.handleAddReference = this.handleAddReference.bind(this); @@ -90,7 +92,8 @@ class PlaylistView extends Component{ this.setState(info.data); this.setState({ playlists: playlists.data.playlists, - newReferenceName: filteredPlaylists.length > 0 ? filteredPlaylists[0].name : '' + newReferenceName: filteredPlaylists.length > 0 ? filteredPlaylists[0].name : '', + isLoading: false }); })) .catch((error) => { @@ -485,8 +488,9 @@ class PlaylistView extends Component{ ); const error =

{ this.state.error_text }

; + const loadingMessage =

loading...

; - return this.state.error ? error : table; + return this.state.isLoading ? loadingMessage : ( this.state.error ? error : table ); } }