check if library is loaded

This commit is contained in:
svetlagasheva 2019-11-21 12:54:16 +02:00
parent f70ca3d293
commit 6aced6fc0e
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ const Library = ({ urlParams, queryParams }) => {
:
error !== null ?
<div className={styles['message-container']}>
No items for type {urlParams.type !== (null && '') ? urlParams.type : '"Empty"'}
{error}
</div>
:
Array.isArray(metaItems) ?

View file

@ -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);