Skip to content

Commit

Permalink
Merge pull request #2146 from lbryio/patch-fixes
Browse files Browse the repository at this point in the history
0.26.1 Fixes
  • Loading branch information
Sean Yesmunt authored Dec 14, 2018
2 parents 8fa5573 + 9c1e743 commit dec5ddd
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 37 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] ([#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))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/component/channelTile/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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=')) {
Expand Down
55 changes: 35 additions & 20 deletions src/renderer/page/rewards/view.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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>
);
}

Expand All @@ -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>
);
}
Expand Down
23 changes: 11 additions & 12 deletions src/renderer/page/subscriptions/internal/first-run.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 />}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dec5ddd

Please sign in to comment.