Updated selection in UpdateSettings for external updaters.
This commit is contained in:
parent
1ccae530d9
commit
565e625e21
|
@ -27,18 +27,21 @@ function UpdateSettings(props) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateOptions = [
|
const usingExternalUpdateMechanism = packageUpdateMechanism !== 'builtIn';
|
||||||
{ key: 'builtIn', value: 'Built-In' },
|
|
||||||
{ key: 'script', value: 'Script' }
|
|
||||||
];
|
|
||||||
|
|
||||||
if (packageUpdateMechanism !== 'builtIn') {
|
const updateOptions = [];
|
||||||
|
|
||||||
|
if (usingExternalUpdateMechanism) {
|
||||||
updateOptions.push({
|
updateOptions.push({
|
||||||
key: packageUpdateMechanism,
|
key: packageUpdateMechanism,
|
||||||
value: titleCase(packageUpdateMechanism)
|
value: titleCase(packageUpdateMechanism)
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
updateOptions.push({ key: 'builtIn', value: 'Built-In' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateOptions.push({ key: 'script', value: 'Script' });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FieldSet legend="Updates">
|
<FieldSet legend="Updates">
|
||||||
<FormGroup
|
<FormGroup
|
||||||
|
@ -50,9 +53,10 @@ function UpdateSettings(props) {
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.TEXT}
|
type={inputTypes.TEXT}
|
||||||
name="branch"
|
name="branch"
|
||||||
helpText="Branch to use to update Sonarr"
|
helpText={usingExternalUpdateMechanism ? 'Branch used by external update mechanism' : 'Branch to use to update Sonarr'}
|
||||||
helpLink="https://github.com/Sonarr/Sonarr/wiki/Release-Branches"
|
helpLink="https://github.com/Sonarr/Sonarr/wiki/Release-Branches"
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
|
readOnly={usingExternalUpdateMechanism}
|
||||||
{...branch}
|
{...branch}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
Loading…
Reference in New Issue