mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Make "max. to download" setting easier to change
This commit is contained in:
parent
245bfe1f6b
commit
0cc254eb20
2 changed files with 5 additions and 3 deletions
|
|
@ -27,10 +27,11 @@ const sortBy = props => {
|
|||
<label htmlFor='maxComments'>max. to download:</label>
|
||||
<span className='space' />
|
||||
<input id='maxComments' onChange={e => {
|
||||
if (e.target.value > props.global.state.maxComments)
|
||||
if (parseInt(e.target.value) > props.global.state.maxComments && props.global.state.maxComments < maxCommentsLimit)
|
||||
setReloadVisible(true)
|
||||
props.global.setMaxComments(e.target.value)
|
||||
}} value={props.global.state.maxComments} type='number' size='5' maxLength='5' required min='100' max={maxCommentsLimit} step='100' />
|
||||
}} onBlur={e => {
|
||||
e.target.value = props.global.setMaxComments(e.target.value)
|
||||
}} defaultValue={props.global.state.maxComments} type='number' size='5' maxLength='5' required min='100' max={maxCommentsLimit} step='100' />
|
||||
{reloadVisible && <>
|
||||
<span className='space' />
|
||||
<input onClick={() => location.replace(location.href)} type='button' value='Reload' />
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class GlobalState extends Container {
|
|||
maxComments = 100
|
||||
put(maxCommentsKey, maxComments)
|
||||
this.setState({maxComments})
|
||||
return maxComments
|
||||
}
|
||||
|
||||
setSuccess = () => this.setState({statusText: '', statusImage: '/images/success.png'})
|
||||
|
|
|
|||
Loading…
Reference in a new issue