Leave fullscreen when player closes

For #3
This commit is contained in:
Feross Aboukhadijeh
2016-03-07 18:39:11 -08:00
parent ca68e85520
commit 35ec241b01

View File

@@ -163,13 +163,7 @@ function dispatch (action, ...args) {
if (action === 'back') { if (action === 'back') {
// TODO // TODO
// window.history.back() // window.history.back()
if (state.url === '/player') { closePlayer()
restoreBounds()
closeServer()
}
state.url = '/'
state.title = config.APP_NAME
update()
} }
if (action === 'forward') { if (action === 'forward') {
// TODO // TODO
@@ -404,6 +398,17 @@ function openPlayer (torrent) {
}) })
} }
function closePlayer () {
state.url = '/'
state.title = config.APP_NAME
if (state.isFullScreen) {
electron.ipcRenderer.send('toggleFullScreen')
}
restoreBounds()
closeServer()
update()
}
function deleteTorrent (torrent) { function deleteTorrent (torrent) {
var ix = state.saved.torrents.findIndex((x) => x.infoHash === torrent.infoHash) var ix = state.saved.torrents.findIndex((x) => x.infoHash === torrent.infoHash)
if (ix > -1) state.saved.torrents.splice(ix, 1) if (ix > -1) state.saved.torrents.splice(ix, 1)