From 6aced6fc0e8f982aeffb316cd3875554bcf4e563 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Thu, 21 Nov 2019 12:54:16 +0200 Subject: [PATCH] check if library is loaded --- src/routes/Library/Library.js | 2 +- src/routes/Library/useLibrary.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Library/Library.js b/src/routes/Library/Library.js index 1b10dc87b..9ea48e5ff 100644 --- a/src/routes/Library/Library.js +++ b/src/routes/Library/Library.js @@ -38,7 +38,7 @@ const Library = ({ urlParams, queryParams }) => { : error !== null ?
- No items for type {urlParams.type !== (null && '') ? urlParams.type : '"Empty"'} + {error}
: Array.isArray(metaItems) ? diff --git a/src/routes/Library/useLibrary.js b/src/routes/Library/useLibrary.js index 240646745..9a3a07895 100644 --- a/src/routes/Library/useLibrary.js +++ b/src/routes/Library/useLibrary.js @@ -30,7 +30,7 @@ const useLibrary = (urlParams) => { window.location.replace(`#/library/${event.value}${search !== null ? search : ''}`); } }; - const error = state.library.items === 0 ? state.library.items : null; + const error = state.ctx.library.Ready.type !== 'Ready' ? state.ctx.library.Ready.type : null; setLibrary([state.library.items, selectInput, error]); }; core.on('NewModel', onNewState);