reverts electron updates testing
This commit is contained in:
parent
72310710af
commit
bf87ac08db
8 changed files with 50 additions and 30 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lbry",
|
"name": "lbry",
|
||||||
"version": "0.52.5-alpha.2",
|
"version": "0.52.4",
|
||||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lbry"
|
"lbry"
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { selectRemoteVersion, selectReleaseNotes } from 'redux/selectors/app';
|
|
||||||
import LastReleaseChanges from './view';
|
import LastReleaseChanges from './view';
|
||||||
|
|
||||||
const select = (state) => ({
|
export default LastReleaseChanges;
|
||||||
releaseVersion: selectRemoteVersion(state),
|
|
||||||
releaseNotes: selectReleaseNotes(state),
|
|
||||||
});
|
|
||||||
|
|
||||||
const perform = () => ({});
|
|
||||||
|
|
||||||
export default connect(select, perform)(LastReleaseChanges);
|
|
||||||
|
|
|
@ -1,21 +1,23 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import MarkdownPreview from 'component/common/markdown-preview';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import I18nMessage from 'component/i18nMessage';
|
import I18nMessage from 'component/i18nMessage';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
hideReleaseVersion?: boolean,
|
hideReleaseVersion?: boolean,
|
||||||
releaseVersion: string,
|
|
||||||
releaseNotes: string,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const LastReleaseChanges = (props: Props) => {
|
const LastReleaseChanges = (props: Props) => {
|
||||||
const { hideReleaseVersion, releaseVersion, releaseNotes } = props;
|
const { hideReleaseVersion } = props;
|
||||||
|
const [releaseTag, setReleaseTag] = useState('');
|
||||||
|
const [releaseChanges, setReleaseChanges] = useState('');
|
||||||
|
const [fetchingReleaseChanges, setFetchingReleaseChanges] = useState(false);
|
||||||
|
const [fetchReleaseFailed, setFetchReleaseFailed] = useState(false);
|
||||||
|
|
||||||
const releaseVersionTitle = (
|
const releaseVersionTitle = (
|
||||||
<p>
|
<p>
|
||||||
{!hideReleaseVersion &&
|
{!hideReleaseVersion && __('A new version %release_tag% of LBRY is ready for you.', { release_tag: releaseTag })}
|
||||||
__('A new version %release_tag% of LBRY is ready for you.', { release_tag: releaseVersion })}
|
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
const seeReleaseNotes = (
|
const seeReleaseNotes = (
|
||||||
|
@ -32,10 +34,47 @@ const LastReleaseChanges = (props: Props) => {
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const lastReleaseUrl = 'https://api.github.com/repos/lbryio/lbry-desktop/releases/latest';
|
||||||
|
const options = {
|
||||||
|
method: 'GET',
|
||||||
|
headers: { Accept: 'application/vnd.github.v3+json' },
|
||||||
|
};
|
||||||
|
|
||||||
|
setFetchingReleaseChanges(true);
|
||||||
|
fetch(lastReleaseUrl, options)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((response) => {
|
||||||
|
setReleaseTag(response.tag_name);
|
||||||
|
setReleaseChanges(response.body);
|
||||||
|
setFetchingReleaseChanges(false);
|
||||||
|
setFetchReleaseFailed(false);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setFetchingReleaseChanges(false);
|
||||||
|
setFetchReleaseFailed(true);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (fetchingReleaseChanges) {
|
||||||
|
return <p>{__('Loading...')}</p>;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fetchReleaseFailed) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{releaseVersionTitle}
|
||||||
|
{seeReleaseNotes}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="release__notes">
|
<div className="release__notes">
|
||||||
{releaseVersionTitle}
|
{releaseVersionTitle}
|
||||||
<p className="last-release-changes" dangerouslySetInnerHTML={{ __html: releaseNotes }} />
|
<p>
|
||||||
|
<MarkdownPreview content={releaseChanges} />
|
||||||
|
</p>
|
||||||
{seeReleaseNotes}
|
{seeReleaseNotes}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -117,13 +117,12 @@ ipcRenderer.on('open-uri-requested', (event, url, newSession) => {
|
||||||
handleError();
|
handleError();
|
||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.on('update-available', (e) => {
|
autoUpdater.on('update-available', ({ version }) => {
|
||||||
app.store.dispatch({
|
app.store.dispatch({
|
||||||
type: ACTIONS.CHECK_UPGRADE_SUCCESS,
|
type: ACTIONS.CHECK_UPGRADE_SUCCESS,
|
||||||
data: {
|
data: {
|
||||||
upgradeAvailable: true,
|
upgradeAvailable: true,
|
||||||
remoteVersion: e.releaseName || e.version,
|
remoteVersion: version,
|
||||||
releaseNotes: e.releaseNotes,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -201,7 +201,6 @@ reducers[ACTIONS.CHECK_UPGRADE_SUCCESS] = (state, action) =>
|
||||||
Object.assign({}, state, {
|
Object.assign({}, state, {
|
||||||
isUpgradeAvailable: action.data.upgradeAvailable,
|
isUpgradeAvailable: action.data.upgradeAvailable,
|
||||||
remoteVersion: action.data.remoteVersion,
|
remoteVersion: action.data.remoteVersion,
|
||||||
releaseNotes: action.data.releaseNotes,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reducers[ACTIONS.CHECK_UPGRADE_SUBSCRIBE] = (state, action) =>
|
reducers[ACTIONS.CHECK_UPGRADE_SUBSCRIBE] = (state, action) =>
|
||||||
|
|
|
@ -23,8 +23,6 @@ export const selectHasClickedComment = createSelector(selectState, (state) => st
|
||||||
|
|
||||||
export const selectRemoteVersion = createSelector(selectState, (state) => state.remoteVersion);
|
export const selectRemoteVersion = createSelector(selectState, (state) => state.remoteVersion);
|
||||||
|
|
||||||
export const selectReleaseNotes = createSelector(selectState, (state) => state.releaseNotes);
|
|
||||||
|
|
||||||
export const selectIsUpgradeAvailable = createSelector(selectState, (state) => state.isUpgradeAvailable);
|
export const selectIsUpgradeAvailable = createSelector(selectState, (state) => state.isUpgradeAvailable);
|
||||||
|
|
||||||
export const selectUpgradeFilename = createSelector(selectPlatform, selectRemoteVersion, (platform, version) => {
|
export const selectUpgradeFilename = createSelector(selectPlatform, selectRemoteVersion, (platform, version) => {
|
||||||
|
|
|
@ -70,4 +70,3 @@
|
||||||
@import 'component/utils';
|
@import 'component/utils';
|
||||||
@import 'component/settings';
|
@import 'component/settings';
|
||||||
@import 'component/embed-player';
|
@import 'component/embed-player';
|
||||||
@import 'component/last-release-changes';
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
.last-release-changes {
|
|
||||||
a {
|
|
||||||
@extend .button--link;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue