Fixed: Select all in Episode File editor

This commit is contained in:
Mark McDowall 2019-02-26 18:54:20 -08:00
parent cbbfc5b58c
commit 1222aeaab6
1 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,9 @@
import _ from 'lodash'; import _ from 'lodash';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import getSelectedIds from 'Utilities/Table/getSelectedIds'; import getSelectedIds from 'Utilities/Table/getSelectedIds';
import removeOldSelectedState from 'Utilities/Table/removeOldSelectedState';
import selectAll from 'Utilities/Table/selectAll'; import selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected'; import toggleSelected from 'Utilities/Table/toggleSelected';
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
@ -66,8 +68,10 @@ class EpisodeFileEditorModalContent extends Component {
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (prevProps.items !== this.props.items) { if (hasDifferentItems(prevProps.items, this.props.items)) {
this.onSelectAllChange({ value: false }); this.setState((state) => {
return removeOldSelectedState(state, prevProps.items);
});
} }
} }