diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 08cf676..36824ad 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1170,7 +1170,7 @@ function parseURIModifier(modSeperator, modValue) { if (modSeperator) { if (!modValue) { - console.error(__(`No modifier provided after separator %modSeperator%.`, { modSeperator })); + throw new Error(__(`No modifier provided after separator %modSeperator%.`, { modSeperator })); } if (modSeperator === '#') { @@ -1183,15 +1183,15 @@ function parseURIModifier(modSeperator, modValue) { } if (claimId && (claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/))) { - console.error(__(`Invalid claim ID %claimId%.`, { claimId })); + throw new Error(__(`Invalid claim ID %claimId%.`, { claimId })); } if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) { - console.error(__('Claim sequence must be a number.')); + throw new Error(__('Claim sequence must be a number.')); } if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) { - console.error(__('Bid position must be a number.')); + throw new Error(__('Bid position must be a number.')); } return [claimId, claimSequence, bidPosition]; @@ -1517,9 +1517,9 @@ var _extends$2 = Object.assign || function (target) { for (var i = 1; i < argume function extractUserState(rawObj) { if (rawObj && rawObj.version === '0.1' && rawObj.value) { - const { subscriptions, tags, blocked, settings } = rawObj.value; + const { subscriptions, tags, blockedChannels, settings } = rawObj.value; - return _extends$2({}, subscriptions ? { subscriptions } : {}, tags ? { tags } : {}, blocked ? { blocked } : {}, settings ? { settings } : {}); + return _extends$2({}, subscriptions ? { subscriptions } : {}, tags ? { tags } : {}, blockedChannels ? { blockedChannels } : {}, settings ? { settings } : {}); } return {}; @@ -1527,8 +1527,8 @@ function extractUserState(rawObj) { function doPopulateSharedUserState(sharedSettings) { return dispatch => { - const { subscriptions, tags, blocked, settings } = extractUserState(sharedSettings); - dispatch({ type: USER_STATE_POPULATE, data: { subscriptions, tags, blocked, settings } }); + const { subscriptions, tags, blockedChannels, settings } = extractUserState(sharedSettings); + dispatch({ type: USER_STATE_POPULATE, data: { subscriptions, tags, blockedChannels, settings } }); }; } @@ -2498,7 +2498,7 @@ function doSendTip(amount, claimId, isSupport, successCallback, errorCallback) { if (balance - amount <= 0) { dispatch(doToast({ - message: 'Insufficient credits', + message: __('Insufficient credits'), isError: true })); return; @@ -2506,7 +2506,7 @@ function doSendTip(amount, claimId, isSupport, successCallback, errorCallback) { const success = () => { dispatch(doToast({ - message: shouldSupport ? __(`You deposited ${amount} LBC as a support!`) : __(`You sent ${amount} LBC as a tip, Mahalo!`), + message: shouldSupport ? __('You deposited %amount% LBC as a support!', { amount }) : __('You sent %amount% LBC as a tip, Mahalo!', { amount }), linkText: __('History'), linkTarget: __('/wallet') })); @@ -5122,9 +5122,9 @@ const blockedReducer = handleActions({ }; }, [USER_STATE_POPULATE]: (state, action) => { - const { blocked } = action.data; + const { blockedChannels } = action.data; return _extends$e({}, state, { - blockedChannels: blocked && blocked.length ? blocked : state.blockedChannels + blockedChannels: blockedChannels && blockedChannels.length ? blockedChannels : state.blockedChannels }); } }, defaultState$9); diff --git a/src/lbryURI.js b/src/lbryURI.js index e6fce46..a019418 100644 --- a/src/lbryURI.js +++ b/src/lbryURI.js @@ -138,7 +138,7 @@ function parseURIModifier(modSeperator: ?string, modValue: ?string) { if (modSeperator) { if (!modValue) { - console.error(__(`No modifier provided after separator %modSeperator%.`, { modSeperator })); + throw new Error(__(`No modifier provided after separator %modSeperator%.`, { modSeperator })); } if (modSeperator === '#') { @@ -151,15 +151,15 @@ function parseURIModifier(modSeperator: ?string, modValue: ?string) { } if (claimId && (claimId.length > claimIdMaxLength || !claimId.match(/^[0-9a-f]+$/))) { - console.error(__(`Invalid claim ID %claimId%.`, { claimId })); + throw new Error(__(`Invalid claim ID %claimId%.`, { claimId })); } if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) { - console.error(__('Claim sequence must be a number.')); + throw new Error(__('Claim sequence must be a number.')); } if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) { - console.error(__('Bid position must be a number.')); + throw new Error(__('Bid position must be a number.')); } return [claimId, claimSequence, bidPosition]; diff --git a/src/redux/actions/sync.js b/src/redux/actions/sync.js index 41a25ea..3957a33 100644 --- a/src/redux/actions/sync.js +++ b/src/redux/actions/sync.js @@ -7,19 +7,19 @@ type SharedData = { value: { subscriptions?: Array, tags?: Array, - blocked?: Array, + blockedChannels?: Array, settings?: any, }, }; function extractUserState(rawObj: SharedData) { if (rawObj && rawObj.version === '0.1' && rawObj.value) { - const { subscriptions, tags, blocked, settings} = rawObj.value; + const { subscriptions, tags, blockedChannels, settings} = rawObj.value; return { ...(subscriptions ? { subscriptions } : {}), ...(tags ? { tags } : {}), - ...(blocked ? { blocked } : {}), + ...(blockedChannels ? { blockedChannels } : {}), ...(settings ? { settings } : {}), }; } @@ -29,8 +29,8 @@ function extractUserState(rawObj: SharedData) { export function doPopulateSharedUserState(sharedSettings: any) { return (dispatch: Dispatch) => { - const { subscriptions, tags, blocked, settings } = extractUserState(sharedSettings); - dispatch({ type: ACTIONS.USER_STATE_POPULATE, data: { subscriptions, tags, blocked, settings } }); + const { subscriptions, tags, blockedChannels, settings } = extractUserState(sharedSettings); + dispatch({ type: ACTIONS.USER_STATE_POPULATE, data: { subscriptions, tags, blockedChannels, settings } }); }; } diff --git a/src/redux/actions/wallet.js b/src/redux/actions/wallet.js index 4fdfb15..4ae4f02 100644 --- a/src/redux/actions/wallet.js +++ b/src/redux/actions/wallet.js @@ -206,7 +206,7 @@ export function doSendTip(amount, claimId, isSupport, successCallback, errorCall if (balance - amount <= 0) { dispatch( doToast({ - message: 'Insufficient credits', + message: __('Insufficient credits'), isError: true, }) ); @@ -217,8 +217,8 @@ export function doSendTip(amount, claimId, isSupport, successCallback, errorCall dispatch( doToast({ message: shouldSupport - ? __(`You deposited ${amount} LBC as a support!`) - : __(`You sent ${amount} LBC as a tip, Mahalo!`), + ? __('You deposited %amount% LBC as a support!', { amount }) + : __('You sent %amount% LBC as a tip, Mahalo!', { amount }), linkText: __('History'), linkTarget: __('/wallet'), }) diff --git a/src/redux/reducers/blocked.js b/src/redux/reducers/blocked.js index b69d9c9..7a9fd85 100644 --- a/src/redux/reducers/blocked.js +++ b/src/redux/reducers/blocked.js @@ -28,13 +28,13 @@ export const blockedReducer = handleActions( }, [ACTIONS.USER_STATE_POPULATE]: ( state: BlocklistState, - action: { data: { blocked: ?Array } } + action: { data: { blockedChannels: ?Array } } ) => { - const { blocked } = action.data; + const { blockedChannels } = action.data; return { ...state, blockedChannels: - blocked && blocked.length ? blocked : state.blockedChannels, + blockedChannels && blockedChannels.length ? blockedChannels : state.blockedChannels, }; }, },