diff --git a/src/routes/Library/Library.js b/src/routes/Library/Library.js index b350ce170..6bc72cd60 100644 --- a/src/routes/Library/Library.js +++ b/src/routes/Library/Library.js @@ -5,7 +5,7 @@ const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('@stremio/stremio-icons/dom'); const NotFound = require('stremio/routes/NotFound'); -const { Button, Multiselect, MainNavBars, LibItem, Image, ModalDialog, PaginationInput, useProfile, routesRegexp, useBinaryState } = require('stremio/common'); +const { Button, DelayedRenderer, Multiselect, MainNavBars, LibItem, Image, ModalDialog, PaginationInput, useProfile, routesRegexp, useBinaryState, withModelSuspender } = require('stremio/common'); const useLibrary = require('./useLibrary'); const useSelectableInputs = require('./useSelectableInputs'); const styles = require('./styles'); @@ -85,14 +85,16 @@ const Library = ({ model, urlParams, queryParams }) => { : library.selected === null ? -
- {' -
{model === 'library' ? 'Library' : 'Continue Watching'} not loaded!
-
+ +
+ {' +
{model === 'library' ? 'Library' : 'Continue Watching'} not loaded!
+
+
: library.catalog.length === 0 ?
@@ -104,7 +106,7 @@ const Library = ({ model, urlParams, queryParams }) => {
Empty {model === 'library' ? 'Library' : 'Continue Watching'}
: -
+
{library.catalog.map((libItem, index) => ( ))} @@ -132,4 +134,10 @@ Library.propTypes = { queryParams: PropTypes.instanceOf(URLSearchParams) }; -module.exports = withModel(Library); +const LibraryFallback = ({ model }) => ( + +); + +LibraryFallback.propTypes = Library.propTypes; + +module.exports = withModel(withModelSuspender(Library, LibraryFallback));