mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fix selecting guids from search results
This commit is contained in:
@@ -30,13 +30,7 @@ import SearchFooterConnector from './SearchFooterConnector';
|
|||||||
import SearchIndexTableConnector from './Table/SearchIndexTableConnector';
|
import SearchIndexTableConnector from './Table/SearchIndexTableConnector';
|
||||||
import styles from './SearchIndex.css';
|
import styles from './SearchIndex.css';
|
||||||
|
|
||||||
function getViewComponent(isSmallScreen) {
|
const getViewComponent = (isSmallScreen) => (isSmallScreen ? SearchIndexOverviewsConnector : SearchIndexTableConnector);
|
||||||
if (isSmallScreen) {
|
|
||||||
return SearchIndexOverviewsConnector;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SearchIndexTableConnector;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SearchIndex extends Component {
|
class SearchIndex extends Component {
|
||||||
|
|
||||||
@@ -78,7 +72,7 @@ class SearchIndex extends Component {
|
|||||||
|
|
||||||
if (sortKey !== prevProps.sortKey ||
|
if (sortKey !== prevProps.sortKey ||
|
||||||
sortDirection !== prevProps.sortDirection ||
|
sortDirection !== prevProps.sortDirection ||
|
||||||
hasDifferentItemsOrOrder(prevProps.items, items)
|
hasDifferentItemsOrOrder(prevProps.items, items, 'guid')
|
||||||
) {
|
) {
|
||||||
this.setJumpBarItems();
|
this.setJumpBarItems();
|
||||||
this.setSelectedState();
|
this.setSelectedState();
|
||||||
@@ -100,7 +94,14 @@ class SearchIndex extends Component {
|
|||||||
if (this.state.allUnselected) {
|
if (this.state.allUnselected) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return getSelectedIds(this.state.selectedState, { parseIds: false });
|
|
||||||
|
return _.reduce(this.state.selectedState, (result, value, id) => {
|
||||||
|
if (value) {
|
||||||
|
result.push(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}, []);
|
||||||
};
|
};
|
||||||
|
|
||||||
setSelectedState() {
|
setSelectedState() {
|
||||||
|
Reference in New Issue
Block a user