From 4eb3fd70e1561b8a857741f80843b614422ac75f Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Tue, 28 Jun 2022 12:23:56 -0300 Subject: [PATCH 1/2] Make install now button display the upgrade modal. --- ui/component/app/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/component/app/index.js b/ui/component/app/index.js index 4726fe72c..39bc71e01 100644 --- a/ui/component/app/index.js +++ b/ui/component/app/index.js @@ -7,6 +7,7 @@ import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { doFetchChannelListMine, doFetchCollectionListMine, doResolveUris } from 'redux/actions/claims'; import { selectMyChannelUrls, selectMyChannelClaimIds } from 'redux/selectors/claims'; import * as SETTINGS from 'constants/settings'; +import * as MODALS from 'constants/modal_types'; import { selectSubscriptions } from 'redux/selectors/subscriptions'; import { makeSelectClientSetting, @@ -24,7 +25,7 @@ import { import { doGetWalletSyncPreference, doSetLanguage } from 'redux/actions/settings'; import { doSyncLoop } from 'redux/actions/sync'; import { - doDownloadUpgradeRequested, + doOpenModal, doSignIn, doGetAndPopulatePreferences, doSetActiveChannel, @@ -60,7 +61,7 @@ const perform = (dispatch) => ({ fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()), setLanguage: (language) => dispatch(doSetLanguage(language)), signIn: () => dispatch(doSignIn()), - requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()), + requestDownloadUpgrade: () => dispatch(doOpenModal(MODALS.UPGRADE)), updatePreferences: () => dispatch(doGetAndPopulatePreferences()), getWalletSyncPref: () => dispatch(doGetWalletSyncPreference()), syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)), From 50fc724b53899b42878668106f0d3ed00b618572 Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Tue, 28 Jun 2022 13:10:49 -0300 Subject: [PATCH 2/2] Use GitHub as provider for manual update url. --- ui/redux/selectors/app.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/redux/selectors/app.js b/ui/redux/selectors/app.js index 920267b62..f48b8e0dc 100644 --- a/ui/redux/selectors/app.js +++ b/ui/redux/selectors/app.js @@ -6,12 +6,20 @@ export const selectState = (state) => state.app || {}; export const selectPlatform = createSelector(selectState, (state) => state.platform); -export const selectUpdateUrl = createSelector(selectPlatform, (platform) => { +export const selectRemoteVersion = createSelector(selectState, (state) => state.remoteVersion); + +export const selectUpdateUrl = createSelector(selectPlatform, selectRemoteVersion, (platform, releaseVersion) => { switch (platform) { case 'darwin': return 'https://lbry.com/get/lbry.dmg'; case 'linux': - return 'https://lbry.com/get/lbry.deb'; + // releaseVersion can be used as the tag name + // Example: v0.53.5-alpha.test7495b + // When downloading, we need to remove the initial + // v, ending up with a file name like + // LBRY_0.53.5-alpha.test7495b.deb + const fileName = 'LBRY_' + (releaseVersion || '').replace('v', '') + '.deb'; + return `https://github.com/lbryio/lbry-desktop/releases/download/${releaseVersion}/${fileName}`; case 'win32': return 'https://lbry.com/get/lbry.exe'; default: @@ -21,8 +29,6 @@ export const selectUpdateUrl = createSelector(selectPlatform, (platform) => { export const selectHasClickedComment = createSelector(selectState, (state) => state.hasClickedComment); -export const selectRemoteVersion = createSelector(selectState, (state) => state.remoteVersion); - export const selectIsUpgradeAvailable = createSelector(selectState, (state) => state.isUpgradeAvailable); export const selectUpgradeInitialized = createSelector(selectState, (state) => state.upgradeInitialized);