From 7cd24c850ae4b746504f7f82191dba60101d6fd0 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Wed, 30 Aug 2017 09:02:40 -0400 Subject: [PATCH] fixes from code review --- ui/js/actions/rewards.js | 5 +---- ui/js/component/publishForm/view.jsx | 5 ++++- ui/js/constants/modal_types.js | 2 +- ui/js/constants/settings.js | 2 ++ ui/js/modal/modalRewardApprovalRequired/view.jsx | 2 +- ui/js/selectors/wallet.js | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/js/actions/rewards.js b/ui/js/actions/rewards.js index 57a45ff19..bc7e13e4a 100644 --- a/ui/js/actions/rewards.js +++ b/ui/js/actions/rewards.js @@ -72,10 +72,7 @@ export function doClaimRewardType(rewardType) { const failure = error => { dispatch({ type: types.CLAIM_REWARD_FAILURE, - data: { - reward, - error: error ? error : null, - }, + data: { reward, error }, }); }; diff --git a/ui/js/component/publishForm/view.jsx b/ui/js/component/publishForm/view.jsx index 8f6d07ffc..4ce8039f8 100644 --- a/ui/js/component/publishForm/view.jsx +++ b/ui/js/component/publishForm/view.jsx @@ -16,6 +16,7 @@ class PublishForm extends React.PureComponent { this._requiredFields = ["name", "bid", "meta_title", "tosAgree"]; this._defaultCopyrightNotice = "All rights reserved."; + this._defaultPaidPrice = 0.01; this.state = { rawName: "", @@ -318,7 +319,9 @@ class PublishForm extends React.PureComponent { handleFeePrefChange(feeEnabled) { this.setState({ isFee: feeEnabled, - feeAmount: this.state.feeAmount == "" ? "0.01" : this.state.feeAmount, + feeAmount: this.state.feeAmount == "" + ? this._defaultPaidPrice + : this.state.feeAmount, }); } diff --git a/ui/js/constants/modal_types.js b/ui/js/constants/modal_types.js index c9d319290..7dd057046 100644 --- a/ui/js/constants/modal_types.js +++ b/ui/js/constants/modal_types.js @@ -7,5 +7,5 @@ export const UPGRADE = "upgrade"; export const WELCOME = "welcome"; export const FIRST_REWARD = "first_reward"; export const AUTHENTICATION_FAILURE = "auth_failure"; -export const REWARD_APPROVAL_REQUIRED = "REWARD_APPROVAL_REQUIRED"; +export const REWARD_APPROVAL_REQUIRED = "reward_approval_required"; export const CREDIT_INTRO = "credit_intro"; diff --git a/ui/js/constants/settings.js b/ui/js/constants/settings.js index b15e32231..146c882cc 100644 --- a/ui/js/constants/settings.js +++ b/ui/js/constants/settings.js @@ -1,4 +1,6 @@ /*hardcoded names still exist for these in reducers/settings.js - only discovered when debugging*/ +/*Many settings are stored in the localStorage by their name - + be careful about changing the value of a settings constant, as doing so can invalidate existing settings*/ export const CREDIT_INTRO_ACKNOWLEDGED = "credit_intro_acknowledged"; export const NEW_USER_ACKNOWLEDGED = "welcome_acknowledged"; export const LANGUAGE = "language"; diff --git a/ui/js/modal/modalRewardApprovalRequired/view.jsx b/ui/js/modal/modalRewardApprovalRequired/view.jsx index bb98d2bf7..fcdab9f98 100644 --- a/ui/js/modal/modalRewardApprovalRequired/view.jsx +++ b/ui/js/modal/modalRewardApprovalRequired/view.jsx @@ -13,7 +13,7 @@ class ModalRewardApprovalRequired extends React.PureComponent { onAborted={closeModal} type="confirm" confirmButtonLabel={__("I'm Totally Real")} - abortButtonLabel={__("Nevermind")} + abortButtonLabel={__("Never Mind")} >

diff --git a/ui/js/selectors/wallet.js b/ui/js/selectors/wallet.js index 0d65f2e6e..1334a17db 100644 --- a/ui/js/selectors/wallet.js +++ b/ui/js/selectors/wallet.js @@ -5,7 +5,7 @@ export const _selectState = state => state.wallet || {}; export const selectBalance = createSelector( _selectState, - state => 0 //state.balance || 0 + state => state.balance || 0 ); export const selectTransactions = createSelector(