From 2adb290c34c2e79231c0fdb2a611b1be0f01f23f Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 5 Jun 2020 11:18:37 -0400 Subject: [PATCH] Do not show a "loading" datagrid for an empty playlist --- ui/src/playlist/PlaylistList.js | 2 +- ui/src/playlist/PlaylistSongs.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/playlist/PlaylistList.js b/ui/src/playlist/PlaylistList.js index b8dde5cba..11629f956 100644 --- a/ui/src/playlist/PlaylistList.js +++ b/ui/src/playlist/PlaylistList.js @@ -20,7 +20,7 @@ const PlaylistFilter = (props) => ( const PlaylistList = (props) => ( }> - isWritable(r.owner)}> + isWritable(r && r.owner)}> diff --git a/ui/src/playlist/PlaylistSongs.js b/ui/src/playlist/PlaylistSongs.js index 170aec790..4038de418 100644 --- a/ui/src/playlist/PlaylistSongs.js +++ b/ui/src/playlist/PlaylistSongs.js @@ -78,7 +78,11 @@ const PlaylistSongs = (props) => { const refresh = useRefresh() const notify = useNotify() const { bulkActionButtons, expand, className, playlistId, readOnly } = props - const { data, ids, version } = controllerProps + const { data, ids, version, total } = controllerProps + + if (total === 0) { + return null + } const anySong = data[ids[0]] const showPlaceholder = !anySong || anySong.playlistId !== playlistId