Prettier fixes

This commit is contained in:
6ea86b96 2017-06-11 00:17:37 +07:00
parent bfa9f6581f
commit 03f0c3ae8f
4 changed files with 21 additions and 27 deletions

View file

@ -12,7 +12,7 @@ export function doFetchCostInfoForUri(uri) {
claim = selectClaimsByUri(state)[uri], claim = selectClaimsByUri(state)[uri],
isGenerous = selectSettingsIsGenerous(state); isGenerous = selectSettingsIsGenerous(state);
if (!claim) return null if (!claim) return null;
function begin() { function begin() {
dispatch({ dispatch({

View file

@ -1,23 +1,19 @@
import React from 'react' import React from "react";
import { import { connect } from "react-redux";
connect import { doUserEmailNew } from "actions/user";
} from 'react-redux'
import {
doUserEmailNew
} from 'actions/user'
import { import {
selectEmailNewIsPending, selectEmailNewIsPending,
selectEmailNewErrorMessage, selectEmailNewErrorMessage,
} from 'selectors/user' } from "selectors/user";
import UserEmailNew from './view' import UserEmailNew from "./view";
const select = (state) => ({ const select = state => ({
isPending: selectEmailNewIsPending(state), isPending: selectEmailNewIsPending(state),
errorMessage: selectEmailNewErrorMessage(state), errorMessage: selectEmailNewErrorMessage(state),
}) });
const perform = (dispatch) => ({ const perform = dispatch => ({
addUserEmail: (email) => dispatch(doUserEmailNew(email)) addUserEmail: email => dispatch(doUserEmailNew(email)),
}) });
export default connect(select, perform)(UserEmailNew) export default connect(select, perform)(UserEmailNew);

View file

@ -22,9 +22,9 @@ reducers[types.RESOLVE_URI_COMPLETED] = function(state, action) {
return Object.assign({}, state, { return Object.assign({}, state, {
byId, byId,
claimsByUri: byUri claimsByUri: byUri,
}); });
} };
reducers[types.RESOLVE_URI_CANCELED] = function(state, action) { reducers[types.RESOLVE_URI_CANCELED] = function(state, action) {
const uri = action.data.uri; const uri = action.data.uri;
@ -42,9 +42,7 @@ reducers[types.FETCH_CLAIM_LIST_MINE_STARTED] = function(state, action) {
}; };
reducers[types.FETCH_CLAIM_LIST_MINE_COMPLETED] = function(state, action) { reducers[types.FETCH_CLAIM_LIST_MINE_COMPLETED] = function(state, action) {
const { const { claims } = action.data;
claims,
} = action.data;
const myClaims = new Set(state.myClaims); const myClaims = new Set(state.myClaims);
const byUri = Object.assign({}, state.claimsByUri); const byUri = Object.assign({}, state.claimsByUri);
const byId = Object.assign({}, state.byId); const byId = Object.assign({}, state.byId);
@ -52,14 +50,14 @@ reducers[types.FETCH_CLAIM_LIST_MINE_COMPLETED] = function(state, action) {
claims.forEach(claim => { claims.forEach(claim => {
myClaims.add(claim.claim_id); myClaims.add(claim.claim_id);
byId[claim.claim_id] = claim; byId[claim.claim_id] = claim;
}) });
return Object.assign({}, state, { return Object.assign({}, state, {
isClaimListMinePending: false, isClaimListMinePending: false,
myClaims: myClaims, myClaims: myClaims,
byId, byId,
}); });
} };
// reducers[types.FETCH_CHANNEL_CLAIMS_STARTED] = function(state, action) { // reducers[types.FETCH_CHANNEL_CLAIMS_STARTED] = function(state, action) {
// const { // const {

View file

@ -5,7 +5,7 @@ const _selectState = state => state.claims || {};
export const selectClaimsById = createSelector( export const selectClaimsById = createSelector(
_selectState, _selectState,
(state) => state.byId || {} state => state.byId || {}
); );
export const selectClaimsByUri = createSelector( export const selectClaimsByUri = createSelector(
@ -28,11 +28,11 @@ export const selectClaimsByUri = createSelector(
claims[uri] = claim; claims[uri] = claim;
} }
}) });
return claims; return claims;
} }
) );
export const selectAllClaimsByChannel = createSelector( export const selectAllClaimsByChannel = createSelector(
_selectState, _selectState,
@ -107,7 +107,7 @@ export const selectMyClaimsOutpoints = createSelector(
claimIds.forEach(claimId => { claimIds.forEach(claimId => {
const claim = byId[claimId]; const claim = byId[claimId];
if (claim) outpoints.push(`${claim.txid}:${claim.nout}`); if (claim) outpoints.push(`${claim.txid}:${claim.nout}`);
}) });
return outpoints; return outpoints;
} }