Fixed: Select all in TrackFile editor

pull/6/head
Qstick 6 years ago
parent 7a66214c6e
commit 27ebe36454

@ -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';
@ -60,8 +62,10 @@ class TrackFileEditorModalContent 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);
});
} }
} }

Loading…
Cancel
Save