Update test 3b #7637

Closed
jessopb wants to merge 14 commits from update-test-3b into master
2 changed files with 13 additions and 4 deletions
Showing only changes of commit 8a7d89c857 - Show all commits

View file

@ -1,3 +1,11 @@
import { connect } from 'react-redux';
import { selectRemoteVersion } from 'redux/selectors/app';
import LastReleaseChanges from './view';
export default LastReleaseChanges;
const select = (state) => ({
releaseVersion: selectRemoteVersion(state),
});
const perform = {};
export default connect(select, perform)(LastReleaseChanges);

View file

@ -5,11 +5,12 @@ import Button from 'component/button';
import I18nMessage from 'component/i18nMessage';
type Props = {
releaseVersion: string,
hideReleaseVersion?: boolean,
};
const LastReleaseChanges = (props: Props) => {
const { hideReleaseVersion } = props;
const { hideReleaseVersion, releaseVersion } = props;
const [releaseTag, setReleaseTag] = useState('');
const [releaseChanges, setReleaseChanges] = useState('');
const [fetchingReleaseChanges, setFetchingReleaseChanges] = useState(false);
@ -35,7 +36,7 @@ const LastReleaseChanges = (props: Props) => {
);
useEffect(() => {
const lastReleaseUrl = 'https://api.github.com/repos/lbryio/lbry-desktop/releases/latest';
const lastReleaseUrl = `https://api.github.com/repos/lbryio/lbry-desktop/releases/tags/${releaseVersion}`;
const options = {
method: 'GET',
headers: { Accept: 'application/vnd.github.v3+json' },
@ -54,7 +55,7 @@ const LastReleaseChanges = (props: Props) => {
setFetchingReleaseChanges(false);
setFetchReleaseFailed(true);
});
}, []);
}, [releaseVersion, setFetchingReleaseChanges, setReleaseTag, setReleaseChanges, setFetchReleaseFailed]);
if (fetchingReleaseChanges) {
return <p>{__('Loading...')}</p>;