Open full path instead of directory during upgrade

This was how it was before the Redux refactor
This commit is contained in:
Alex Liebowitz 2017-06-01 02:51:16 -04:00
parent fcfce1bf64
commit c7bab43b7b
3 changed files with 7 additions and 10 deletions

View file

@ -2,7 +2,7 @@ import * as types from 'constants/action_types'
import lbry from 'lbry' import lbry from 'lbry'
import { import {
selectUpdateUrl, selectUpdateUrl,
selectUpgradeDownloadDir, selectUpgradeDownloadPath,
selectUpgradeDownloadItem, selectUpgradeDownloadItem,
selectUpgradeFilename, selectUpgradeFilename,
selectPageTitle, selectPageTitle,
@ -110,7 +110,7 @@ export function doSkipUpgrade() {
export function doStartUpgrade() { export function doStartUpgrade() {
return function(dispatch, getState) { return function(dispatch, getState) {
const state = getState() const state = getState()
const upgradeDownloadPath = selectUpgradeDownloadDir(state) const upgradeDownloadPath = selectUpgradeDownloadPath(state)
ipcRenderer.send('upgrade', upgradeDownloadPath) ipcRenderer.send('upgrade', upgradeDownloadPath)
} }
@ -135,14 +135,11 @@ export function doDownloadUpgrade() {
* too soon. * too soon.
*/ */
const _upgradeDownloadItem = downloadItem;
const _upgradeDownloadPath = path.join(dir, upgradeFilename);
dispatch({ dispatch({
type: types.UPGRADE_DOWNLOAD_COMPLETED, type: types.UPGRADE_DOWNLOAD_COMPLETED,
data: { data: {
dir, downloadItem,
downloadItem path: path.join(dir, upgradeFilename)
} }
}) })
}); });

View file

@ -34,7 +34,7 @@ reducers[types.UPGRADE_CANCELLED] = function(state, action) {
reducers[types.UPGRADE_DOWNLOAD_COMPLETED] = function(state, action) { reducers[types.UPGRADE_DOWNLOAD_COMPLETED] = function(state, action) {
return Object.assign({}, state, { return Object.assign({}, state, {
downloadDir: action.data.dir, downloadPath: action.data.path,
upgradeDownloading: false, upgradeDownloading: false,
upgradeDownloadCompleted: true upgradeDownloadCompleted: true
}) })

View file

@ -170,9 +170,9 @@ export const selectUpgradeSkipped = createSelector(
(state) => state.upgradeSkipped (state) => state.upgradeSkipped
) )
export const selectUpgradeDownloadDir = createSelector( export const selectUpgradeDownloadPath = createSelector(
_selectState, _selectState,
(state) => state.downloadDir (state) => state.downloadPath
) )
export const selectUpgradeDownloadItem = createSelector( export const selectUpgradeDownloadItem = createSelector(