Skip to content

Commit

Permalink
Fix changing filters not resetting multiselected media cards
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorS1110 committed Jun 9, 2024
1 parent 6f9376b commit fba3cc4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
- [David Angel](https://github.com/davidangel)
- [Pithaya](https://github.com/Pithaya)
- [Chaitanya Shahare](https://github.com/Chaitanya-Shahare)
- [Connor Smith](https://github.com/ConnorS1110)

## Emby Contributors

Expand Down
4 changes: 3 additions & 1 deletion src/components/filterdialog/filterdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../elements/emby-collapse/emby-collapse';
import './style.scss';
import ServerConnections from '../ServerConnections';
import template from './filterdialog.template.html';
import { stopMultiSelect } from '../../components/multiSelect/multiSelect';

function renderOptions(context, selector, cssClass, items, isCheckedFn) {
const elem = context.querySelector(selector);
Expand Down Expand Up @@ -103,7 +104,8 @@ function updateFilterControls(context, options) {
/**
* @param instance {FilterDialog} An instance of FilterDialog
*/
function triggerChange(instance) {
function triggerChange (instance) {
stopMultiSelect();
Events.trigger(instance, 'filterchange');
}

Expand Down
4 changes: 4 additions & 0 deletions src/components/multiSelect/multiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,7 @@ export default function (options) {
export const startMultiSelect = (card) => {
showSelections(card);
};

export const stopMultiSelect = () => {
hideSelections();
};
7 changes: 5 additions & 2 deletions src/controllers/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ServerConnections from '../components/ServerConnections';
import LibraryMenu from '../scripts/libraryMenu';
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
import { ItemSortBy } from '@jellyfin/sdk/lib/generated-client/models/item-sort-by';
import { stopMultiSelect } from 'components/multiSelect/multiSelect';

function getInitialLiveTvQuery(instance, params, startIndex = 0, limit = 300) {
const query = {
Expand Down Expand Up @@ -1137,8 +1138,11 @@ class ItemsView {
return filters;
}

setFilterStatus(hasFilters) {
setFilterStatus (hasFilters) {
this.hasFilters = hasFilters;
if (this.hasFilters) {
stopMultiSelect();
}
const filterButtons = this.filterButtons;

if (filterButtons.length) {
Expand Down Expand Up @@ -1301,4 +1305,3 @@ class ItemsView {
}

export default ItemsView;

1 change: 0 additions & 1 deletion src/controllers/movies/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,3 @@ export default function (view, params, tabContent, options) {
itemsContainer = null;
};
}

0 comments on commit fba3cc4

Please sign in to comment.