Merge pull request #2146 from lbryio/patch-fixes

0.26.1 Fixes
This commit is contained in:
Sean Yesmunt 2018-12-14 11:20:35 -05:00 committed by GitHub
commit dec5ddd5b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 37 deletions

View file

@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
### Changed
### Fixed
* Channel subscribe button on search page ([#2146](https://github.com/lbryio/lbry-desktop/pull/2146))
* Close modal after redeeming reward code ([#2146](https://github.com/lbryio/lbry-desktop/pull/2146))
* Update Electron to prevent segfault on Ubuntu@18.10 ([#2146](https://github.com/lbryio/lbry-desktop/pull/2146))
* Show reward code modal when all rewards are claimed ([#2146](https://github.com/lbryio/lbry-desktop/pull/2146))
## [0.26.0] - 2018-12-12
### Added
* Redemption of custom reward codes via Rewards page ([#1935](https://github.com/lbryio/lbry-desktop/pull/1935))
* Ability to manage email preferences from Help page ([#1929](https://github.com/lbryio/lbry-desktop/pull/1929))

View file

@ -99,7 +99,7 @@
"decompress": "^4.2.0",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.6",
"electron": "^2.0.14",
"electron-builder": "^20.22.0",
"electron-devtools-installer": "^2.2.3",
"electron-publisher-s3": "^20.8.1",

View file

@ -42,7 +42,7 @@ class ChannelTile extends React.PureComponent<Props> {
let subscriptionUri;
if (claim) {
channelName = claim.name;
subscriptionUri = claim.permanent_url;
subscriptionUri = `lbry://${claim.permanent_url}`;
}
const onClick = () => navigate('/show', { uri });

View file

@ -15,6 +15,7 @@ import {
doDaemonReady,
doAutoUpdate,
doOpenModal,
doHideModal,
} from 'redux/actions/app';
import { doToast, doBlackListedOutpointsSubscribe, isURIValid } from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation';
@ -88,6 +89,10 @@ rewards.setCallback('rewardApprovalRequired', () => {
app.store.dispatch(doOpenModal(MODALS.REWARD_APPROVAL_REQUIRED));
});
rewards.setCallback('claimRewardSuccess', () => {
app.store.dispatch(doHideModal(MODALS.REWARD_APPROVAL_REQUIRED));
});
ipcRenderer.on('open-uri-requested', (event, uri, newSession) => {
if (uri && uri.startsWith('lbry://')) {
if (uri.startsWith('lbry://?verify=')) {

View file

@ -1,5 +1,5 @@
// @flow
import React from 'react';
import React, { PureComponent, Fragment } from 'react';
import BusyIndicator from 'component/common/busy-indicator';
import RewardListClaimed from 'component/rewardListClaimed';
import RewardTile from 'component/rewardTile';
@ -26,7 +26,7 @@ type Props = {
},
};
class RewardsPage extends React.PureComponent<Props> {
class RewardsPage extends PureComponent<Props> {
renderPageHeader() {
const { doAuth, navigate, user, daemonSettings } = this.props;
@ -76,6 +76,21 @@ class RewardsPage extends React.PureComponent<Props> {
return null;
}
renderCustomRewardCode() {
return (
<RewardTile
key={REWARD_TYPES.TYPE_GENERATED_CODE}
reward={{
reward_type: REWARD_TYPES.TYPE_GENERATED_CODE,
reward_title: __('Custom Code'),
reward_description: __(
'Are you a supermodel or rockstar that received a custom reward code? Claim it here.'
),
}}
/>
);
}
renderUnclaimedRewards() {
const { fetching, rewards, user, daemonSettings, navigate, claimed } = this.props;
@ -108,13 +123,20 @@ class RewardsPage extends React.PureComponent<Props> {
);
} else if (!rewards || rewards.length <= 0) {
return (
<div className="card__content">
{claimed && claimed.length
? __(
"You have claimed all available rewards! We're regularly adding more so be sure to check back later."
)
: __('There are no rewards available at this time, please check back later.')}
</div>
<Fragment>
<div className="card--section">
<h2 className="card__title">{__('No Rewards Available')}</h2>
<p>
{claimed && claimed.length
? __(
"You have claimed all available rewards! We're regularly adding more so be sure to check back later."
)
: __('There are no rewards available at this time, please check back later.')}
</p>
</div>
<div className="card__content card__list--rewards">{this.renderCustomRewardCode()}</div>
</Fragment>
);
}
@ -126,17 +148,10 @@ class RewardsPage extends React.PureComponent<Props> {
'card--disabled': isNotEligible,
})}
>
{rewards.map(reward => <RewardTile key={reward.reward_type} reward={reward} />)}
<RewardTile
key={REWARD_TYPES.TYPE_GENERATED_CODE}
reward={{
reward_type: REWARD_TYPES.TYPE_GENERATED_CODE,
reward_title: __('Custom Code'),
reward_description: __(
'Are you a supermodel or rockstar that received a custom reward code? Claim it here.'
),
}}
/>
{rewards.map(reward => (
<RewardTile key={reward.reward_type} reward={reward} />
))}
{this.renderCustomRewardCode()}
</div>
);
}

View file

@ -43,18 +43,17 @@ export default (props: Props) => {
<Button button="primary" label={__('Explore')} onClick={doShowSuggestedSubs} />
</div>
)}
{showSuggested &&
numberOfSubscriptions > 0 && (
<div className="card__actions">
<Button
button="primary"
onClick={onFinish}
label={`${__('View your')} ${numberOfSubscriptions} ${
numberOfSubscriptions > 1 ? __('subcriptions') : __('subscription')
}`}
/>
</div>
)}
{showSuggested && numberOfSubscriptions > 0 && (
<div className="card__actions">
<Button
button="primary"
onClick={onFinish}
label={`${__('View your')} ${numberOfSubscriptions} ${
numberOfSubscriptions > 1 ? __('subscribed channels') : __('subscribed channel')
}`}
/>
</div>
)}
</div>
</div>
{showSuggested && !loadingSuggested && <SuggestedSubscriptions />}

View file

@ -3185,9 +3185,9 @@ electron-window-state@^4.1.1:
jsonfile "^2.2.3"
mkdirp "^0.5.1"
electron@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.6.tgz#8e5c1bd2ebc08fa7a6ee906de3753c1ece9d7300"
electron@^2.0.14:
version "2.0.14"
resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.14.tgz#fad6766645e7c0cd10b4ae822d3167959735a870"
dependencies:
"@types/node" "^8.0.24"
electron-download "^3.0.1"