From 9bb58d8fc60dc29b7185fc08bd429a1e933e201d Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Tue, 12 Jun 2018 18:18:45 +0200 Subject: [PATCH 1/4] Fix load state never set to true --- src/components/modals/ReleaseNotes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/modals/ReleaseNotes.js b/src/components/modals/ReleaseNotes.js index 62a55912..f88c54db 100644 --- a/src/components/modals/ReleaseNotes.js +++ b/src/components/modals/ReleaseNotes.js @@ -156,6 +156,10 @@ class ReleaseNotes extends PureComponent { fetchNotes = version => { if (!this.state.loading) { + this.setState({ + loading: true + }) + axios .get(`https://api.github.com/repos/LedgerHQ/ledger-live-desktop/releases/tags/v${version}`) .then(response => { From c92030af03a5ea3dfb6e1201013a53ae55a581cb Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Tue, 12 Jun 2018 18:35:59 +0200 Subject: [PATCH 2/4] Show version and release notes in about --- src/components/SettingsPage/sections/About.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/components/SettingsPage/sections/About.js b/src/components/SettingsPage/sections/About.js index 54674256..14e0ca13 100644 --- a/src/components/SettingsPage/sections/About.js +++ b/src/components/SettingsPage/sections/About.js @@ -2,11 +2,16 @@ import React, { PureComponent } from 'react' import { shell } from 'electron' +import { connect } from 'react-redux' import type { T } from 'types/common' import IconHelp from 'icons/Help' import IconExternalLink from 'icons/ExternalLink' +import Button from 'components/base/Button' + +import { openModal } from 'reducers/modals' +import { MODAL_RELEASES_NOTES } from 'config/constants' import { SettingsSection as Section, @@ -17,13 +22,20 @@ import { type Props = { t: T, + openModal: Function, +} + +const mapDispatchToProps = { + openModal, } class SectionAbout extends PureComponent { handleOpenLink = (url: string) => () => shell.openExternal(url) render() { - const { t } = this.props + const { t, openModal } = this.props + const version = __APP_VERSION__ + return (
{ desc="Lorem ipsum dolor sit amet" /> + + + { } } -export default SectionAbout +export default connect( + null, + mapDispatchToProps, +)(SectionAbout) From 71826b69313de1f3be9ec0e50ad3189174dff4e5 Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Tue, 12 Jun 2018 18:45:51 +0200 Subject: [PATCH 3/4] Removed lastUsedVersion hack --- src/reducers/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/settings.js b/src/reducers/settings.js index b97f552d..b70e5603 100644 --- a/src/reducers/settings.js +++ b/src/reducers/settings.js @@ -74,7 +74,7 @@ const INITIAL_STATE: SettingsState = { loaded: false, shareAnalytics: false, sentryLogs: false, - lastUsedVersion: '0.1.0-alpha.7', // Temp hack to show release notes on update to alpha 8, should ne replaced by __APP_VERSION__ + lastUsedVersion: __APP_VERSION__, } function asCryptoCurrency(c: Currency): ?CryptoCurrency { From 845e2871176fd8155a31817bde7298148214771e Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Wed, 13 Jun 2018 11:13:14 +0200 Subject: [PATCH 4/4] Prettify --- src/components/modals/ReleaseNotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/modals/ReleaseNotes.js b/src/components/modals/ReleaseNotes.js index f88c54db..b9f46672 100644 --- a/src/components/modals/ReleaseNotes.js +++ b/src/components/modals/ReleaseNotes.js @@ -157,7 +157,7 @@ class ReleaseNotes extends PureComponent { fetchNotes = version => { if (!this.state.loading) { this.setState({ - loading: true + loading: true, }) axios