move more state into state.view

This commit is contained in:
Feross Aboukhadijeh
2016-03-03 17:19:31 -08:00
parent db29ba7535
commit d72999df57
4 changed files with 24 additions and 34 deletions

View File

@@ -11,10 +11,10 @@ function App (state, dispatch) {
Header(state, dispatch),
h('.content', [
(function () {
if (state.player === 'local') {
return Player(state, dispatch)
} else {
if (state.view.url === '/') {
return TorrentList(state, dispatch)
} else if (state.view.url === '/player') {
return Player(state, dispatch)
}
})()
])

View File

@@ -14,7 +14,7 @@ function Header (state, dispatch) {
}, 'chevron_right')
]),
(function () {
if (state.player !== 'local') {
if (state.url !== '/player') {
return h('.nav.right', [
h('i.icon.add', {
onclick: onAddTorrent

View File

@@ -42,7 +42,7 @@ function TorrentList (state, dispatch) {
}
})(),
(function () {
if (state.view.airplay) {
if (state.view.devices.airplay) {
return h('i.btn.icon.airplay', {
className: !torrent.ready ? 'disabled' : '',
onclick: openAirplay