1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-21 23:32:27 +00:00

Fallback value for statistics

This commit is contained in:
Bogdan 2024-05-10 19:42:10 +03:00
parent 0300bf2dd2
commit 18772553f2
5 changed files with 8 additions and 9 deletions

View file

@ -53,7 +53,7 @@ class DeleteAlbumModalContent extends Component {
render() {
const {
title,
statistics,
statistics = {},
onModalClose
} = this.props;

View file

@ -35,7 +35,7 @@ class EditAlbumModalContent extends Component {
title,
artistName,
albumType,
statistics,
statistics = {},
item,
isSaving,
onInputChange,

View file

@ -135,14 +135,14 @@ class DeleteArtistModalContent extends Component {
<ModalFooter>
<Button onPress={onModalClose}>
Close
{translate('Close')}
</Button>
<Button
kind={kinds.DANGER}
onPress={this.onDeleteArtistConfirmed}
>
Delete
{translate('Delete')}
</Button>
</ModalFooter>
</ModalContent>
@ -161,9 +161,7 @@ DeleteArtistModalContent.propTypes = {
};
DeleteArtistModalContent.defaultProps = {
statistics: {
trackFileCount: 0
}
statistics: {}
};
export default DeleteArtistModalContent;

View file

@ -192,7 +192,7 @@ class ArtistDetails extends Component {
artistName,
ratings,
path,
statistics,
statistics = {},
qualityProfileId,
monitored,
genres,

View file

@ -1,6 +1,7 @@
import _ from 'lodash';
import React, { useEffect, useMemo } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Statistics } from 'Album/Album';
import Alert from 'Components/Alert';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import { kinds } from 'Helpers/Props';
@ -56,7 +57,7 @@ function AlbumDetails(props: AlbumDetailsProps) {
disambiguation,
albumType,
monitored,
statistics,
statistics = {} as Statistics,
isSaving = false,
} = album;