Use dispatch('setTitle') and add dispatch('resetTitle')
This commit is contained in:
@@ -242,7 +242,7 @@ module.exports = class PlaybackController {
|
||||
}
|
||||
|
||||
// otherwise, play the video
|
||||
state.window.title = torrentSummary.files[state.playing.fileIndex].name
|
||||
dispatch('setTitle', torrentSummary.files[state.playing.fileIndex].name)
|
||||
this.update()
|
||||
|
||||
ipcRenderer.send('onPlayerOpen')
|
||||
@@ -274,7 +274,7 @@ module.exports = class PlaybackController {
|
||||
else console.error('Unknown state.playing.result', state.playing.result)
|
||||
|
||||
// Reset the window contents back to the home screen
|
||||
state.window.title = this.config.APP_WINDOW_TITLE
|
||||
dispatch('resetTitle')
|
||||
state.playing = State.getDefaultPlayState()
|
||||
state.server = null
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const {dispatch} = require('../lib/dispatcher')
|
||||
const State = require('../lib/state')
|
||||
|
||||
// Controls the Preferences screen
|
||||
@@ -14,14 +15,14 @@ module.exports = class PrefsController {
|
||||
url: 'preferences',
|
||||
onbeforeload: function (cb) {
|
||||
// initialize preferences
|
||||
state.window.title = 'Preferences'
|
||||
dispatch('setTitle', 'Preferences')
|
||||
state.unsaved = Object.assign(state.unsaved || {}, {prefs: state.saved.prefs || {}})
|
||||
cb()
|
||||
},
|
||||
onbeforeunload: (cb) => {
|
||||
// save state after preferences
|
||||
this.save()
|
||||
state.window.title = this.config.APP_WINDOW_TITLE
|
||||
dispatch('resetTitle')
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user