diff --git a/main/index.js b/main/index.js index 76632ad2..6b6f63bf 100644 --- a/main/index.js +++ b/main/index.js @@ -43,7 +43,7 @@ function init () { app.setPath('userData', config.CONFIG_PATH) } - app.isReady = false // app ready, windows can be created + var isReady = false // app ready, windows can be created app.ipcReady = false // main window has finished loading and IPC is ready app.isQuitting = false @@ -58,7 +58,7 @@ function init () { }) app.on('ready', function () { - app.isReady = true + isReady = true windows.createMainWindow() windows.createWebTorrentHiddenWindow() @@ -86,7 +86,7 @@ function init () { }) app.on('activate', function () { - if (app.isReady) windows.createMainWindow() + if (isReady) windows.createMainWindow() }) } diff --git a/renderer/index.js b/renderer/index.js index 402ec381..8ca14a44 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -423,6 +423,8 @@ function openSubtitles () { properties: [ 'openFile' ] }, function (filenames) { if (!Array.isArray(filenames)) return + // autoselect the newly added subtitle tracks + state.playing.subtitles.selectedIndex = -1 addSubtitle({path: filenames[0]}, true) }) } @@ -543,6 +545,8 @@ function onOpen (files) { // In the player, the only drag-drop function is adding subtitles var isInPlayer = state.location.current().url === 'player' if (isInPlayer) { + // always autoselect one of the newly added subtitle tracks + state.playing.subtitles.selectedIndex = -1 return files.filter(isSubtitle).forEach((file) => addSubtitle(file, true)) }