1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-26 07:42:49 +00:00

Fixed: Highlight currently install version of Lidarr in Updates

This commit is contained in:
Qstick 2019-04-06 22:50:53 -04:00
parent 5643923299
commit 11eaa58c1c
3 changed files with 26 additions and 4 deletions

View file

@ -49,7 +49,7 @@
font-size: 16px; font-size: 16px;
} }
.branch { .label {
composes: label from '~Components/Label.css'; composes: label from '~Components/Label.css';
margin-left: 10px; margin-left: 10px;

View file

@ -19,6 +19,7 @@ class Updates extends Component {
render() { render() {
const { const {
currentVersion,
isFetching, isFetching,
isPopulated, isPopulated,
error, error,
@ -119,13 +120,25 @@ class Updates extends Component {
<div className={styles.date}>{formatDate(update.releaseDate, shortDateFormat)}</div> <div className={styles.date}>{formatDate(update.releaseDate, shortDateFormat)}</div>
{ {
update.branch !== 'master' && update.branch === 'master' ?
null :
<Label <Label
className={styles.branch} className={styles.label}
> >
{update.branch} {update.branch}
</Label> </Label>
} }
{
update.version === currentVersion ?
<Label
className={styles.label}
kind={kinds.SUCCESS}
>
Currently Installed
</Label> :
null
}
</div> </div>
{ {
@ -168,6 +181,7 @@ class Updates extends Component {
} }
Updates.propTypes = { Updates.propTypes = {
currentVersion: PropTypes.string.isRequired,
isFetching: PropTypes.bool.isRequired, isFetching: PropTypes.bool.isRequired,
isPopulated: PropTypes.bool.isRequired, isPopulated: PropTypes.bool.isRequired,
error: PropTypes.object, error: PropTypes.object,

View file

@ -12,11 +12,18 @@ import Updates from './Updates';
function createMapStateToProps() { function createMapStateToProps() {
return createSelector( return createSelector(
(state) => state.app.version,
(state) => state.system.updates, (state) => state.system.updates,
createUISettingsSelector(), createUISettingsSelector(),
createCommandExecutingSelector(commandNames.APPLICATION_UPDATE), createCommandExecutingSelector(commandNames.APPLICATION_UPDATE),
createSystemStatusSelector(), createSystemStatusSelector(),
(updates, uiSettings, isInstallingUpdate, systemStatus) => { (
currentVersion,
updates,
uiSettings,
isInstallingUpdate,
systemStatus
) => {
const { const {
isFetching, isFetching,
isPopulated, isPopulated,
@ -25,6 +32,7 @@ function createMapStateToProps() {
} = updates; } = updates;
return { return {
currentVersion,
isFetching, isFetching,
isPopulated, isPopulated,
error, error,