Fixed: Show Loading Indicator for Manage TrackFiles Modal

pull/6/head
Qstick 6 years ago
parent 9b9ca54e65
commit 529ab29489

@ -7,6 +7,7 @@ import toggleSelected from 'Utilities/Table/toggleSelected';
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
import ConfirmModal from 'Components/Modal/ConfirmModal'; import ConfirmModal from 'Components/Modal/ConfirmModal';
import Button from 'Components/Link/Button'; import Button from 'Components/Link/Button';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import SpinnerButton from 'Components/Link/SpinnerButton'; import SpinnerButton from 'Components/Link/SpinnerButton';
import SelectInput from 'Components/Form/SelectInput'; import SelectInput from 'Components/Form/SelectInput';
import ModalContent from 'Components/Modal/ModalContent'; import ModalContent from 'Components/Modal/ModalContent';
@ -133,6 +134,7 @@ class TrackFileEditorModalContent extends Component {
render() { render() {
const { const {
isDeleting, isDeleting,
isFetching,
items, items,
languages, languages,
qualities, qualities,
@ -174,14 +176,19 @@ class TrackFileEditorModalContent extends Component {
<ModalBody> <ModalBody>
{ {
!items.length && isFetching &&
<LoadingIndicator />
}
{
!isFetching && !items.length &&
<div> <div>
No track files to manage. No track files to manage.
</div> </div>
} }
{ {
!!items.length && !isFetching && !!items.length &&
<Table <Table
columns={columns} columns={columns}
selectAll={true} selectAll={true}
@ -262,6 +269,7 @@ class TrackFileEditorModalContent extends Component {
TrackFileEditorModalContent.propTypes = { TrackFileEditorModalContent.propTypes = {
isDeleting: PropTypes.bool.isRequired, isDeleting: PropTypes.bool.isRequired,
isFetching: PropTypes.bool.isRequired,
items: PropTypes.arrayOf(PropTypes.object).isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired,
languages: PropTypes.arrayOf(PropTypes.object).isRequired, languages: PropTypes.arrayOf(PropTypes.object).isRequired,
qualities: PropTypes.arrayOf(PropTypes.object).isRequired, qualities: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -59,6 +59,7 @@ function createMapStateToProps() {
items, items,
artistType: artist.artistType, artistType: artist.artistType,
isDeleting: trackFiles.isDeleting, isDeleting: trackFiles.isDeleting,
isFetching: tracks.isFetching || trackFiles.isFetching,
isSaving: trackFiles.isSaving, isSaving: trackFiles.isSaving,
languages, languages,
qualities qualities

Loading…
Cancel
Save