Style: no more var
This commit is contained in:
@@ -6,20 +6,20 @@ const {dispatcher} = require('../lib/dispatcher')
|
||||
|
||||
module.exports = class UnsupportedMediaModal extends React.Component {
|
||||
render () {
|
||||
var state = this.props.state
|
||||
var err = state.modal.error
|
||||
var message = (err && err.getMessage)
|
||||
const state = this.props.state
|
||||
const err = state.modal.error
|
||||
const message = (err && err.getMessage)
|
||||
? err.getMessage()
|
||||
: err
|
||||
var playerPath = state.saved.prefs.externalPlayerPath
|
||||
var playerName = playerPath
|
||||
const playerPath = state.saved.prefs.externalPlayerPath
|
||||
const playerName = playerPath
|
||||
? path.basename(playerPath).split('.')[0]
|
||||
: 'VLC'
|
||||
var onPlay = dispatcher('openExternalPlayer')
|
||||
var actionButton = state.modal.externalPlayerInstalled
|
||||
const onPlay = dispatcher('openExternalPlayer')
|
||||
const actionButton = state.modal.externalPlayerInstalled
|
||||
? (<button className='button-raised' onClick={onPlay}>Play in {playerName}</button>)
|
||||
: (<button className='button-raised' onClick={() => this.onInstall()}>Install VLC</button>)
|
||||
var playerMessage = state.modal.externalPlayerNotFound
|
||||
const playerMessage = state.modal.externalPlayerNotFound
|
||||
? 'Couldn\'t run external player. Please make sure it\'s installed.'
|
||||
: ''
|
||||
return (
|
||||
@@ -39,7 +39,7 @@ module.exports = class UnsupportedMediaModal extends React.Component {
|
||||
electron.shell.openExternal('http://www.videolan.org/vlc/')
|
||||
|
||||
// TODO: dcposch send a dispatch rather than modifying state directly
|
||||
var state = this.props.state
|
||||
const state = this.props.state
|
||||
state.modal.externalPlayerInstalled = true // Assume they'll install it successfully
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user