This commit is contained in:
Feross Aboukhadijeh
2019-08-14 17:09:07 -07:00
parent cf6b46364c
commit 44e2f366ce
2 changed files with 8 additions and 8 deletions

View File

@@ -65,9 +65,9 @@ class CreateTorrentPage extends React.Component {
} }
// Create React event handlers only once // Create React event handlers only once
this.setIsPrivate = (_, isPrivate) => this.setState({ isPrivate }) this.handleSetIsPrivate = (_, isPrivate) => this.setState({ isPrivate })
this.setComment = (_, comment) => this.setState({ comment }) this.handleSetComment = (_, comment) => this.setState({ comment })
this.setTrackers = (_, trackers) => this.setState({ trackers }) this.handleSetTrackers = (_, trackers) => this.setState({ trackers })
this.handleSubmit = handleSubmit.bind(this) this.handleSubmit = handleSubmit.bind(this)
} }
@@ -146,7 +146,7 @@ class CreateTorrentPage extends React.Component {
className='torrent-is-private control' className='torrent-is-private control'
style={{ display: '' }} style={{ display: '' }}
checked={this.state.isPrivate} checked={this.state.isPrivate}
onCheck={this.setIsPrivate} onCheck={this.handleSetIsPrivate}
/> />
</div> </div>
<div key='trackers' className='torrent-attribute'> <div key='trackers' className='torrent-attribute'>
@@ -159,7 +159,7 @@ class CreateTorrentPage extends React.Component {
rows={2} rows={2}
rowsMax={10} rowsMax={10}
value={this.state.trackers} value={this.state.trackers}
onChange={this.setTrackers} onChange={this.handleSetTrackers}
/> />
</div> </div>
<div key='comment' className='torrent-attribute'> <div key='comment' className='torrent-attribute'>
@@ -173,7 +173,7 @@ class CreateTorrentPage extends React.Component {
rows={2} rows={2}
rowsMax={10} rowsMax={10}
value={this.state.comment} value={this.state.comment}
onChange={this.setComment} onChange={this.handleSetComment}
/> />
</div> </div>
<div key='files' className='torrent-attribute'> <div key='files' className='torrent-attribute'>

View File

@@ -157,7 +157,7 @@ class PreferencesPage extends React.Component {
properties: ['openDirectory'] properties: ['openDirectory']
}} }}
displayValue={torrentsFolderPath || ''} displayValue={torrentsFolderPath || ''}
onChange={this.handletorrentsFolderPathChange} onChange={this.handleTorrentsFolderPathChange}
title='Folder to watch' title='Folder to watch'
value={torrentsFolderPath ? path.dirname(torrentsFolderPath) : null} value={torrentsFolderPath ? path.dirname(torrentsFolderPath) : null}
/> />
@@ -165,7 +165,7 @@ class PreferencesPage extends React.Component {
) )
} }
handletorrentsFolderPathChange (filePath) { handleTorrentsFolderPathChange (filePath) {
dispatch('updatePreferences', 'torrentsFolderPath', filePath) dispatch('updatePreferences', 'torrentsFolderPath', filePath)
} }