Fixing failed api requests.

This commit is contained in:
Roland 2022-05-01 21:12:39 -06:00
parent 3673092847
commit e5b2135cb2
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 4 additions and 6 deletions

View file

@ -306,15 +306,13 @@ class Videos extends React.Component {
// Pass any enabled filters to the search.
let filtersArr = this.enabledFilters();
let videos = [];
let total = 0;
try {
let [videos, total] = await searchVideos(offset, limit, channel_id, queryStr, searchOrder, filtersArr);
let totalPages = Math.round(total / this.state.limit) || 1;
this.setState({videos, totalPages});
} catch (e) {
console.error(e);
}
let totalPages = Math.round(total / this.state.limit) || 1;
this.setState({videos, totalPages});
}
changePage = async (activePage) => {