updated build

This commit is contained in:
Akinwale Ariwodola 2018-04-04 15:19:19 +01:00
parent b8e0c37a0c
commit ef561a11e3
2 changed files with 58 additions and 44 deletions

View file

@ -84,12 +84,14 @@ export function doAbandonClaim(txid, nout) {
}); });
const errorCallback = () => { const errorCallback = () => {
dispatch(doNotify({ dispatch(
title: 'Transaction failed', doNotify({
message: 'Transaction failed', title: 'Transaction failed',
type: 'error', message: 'Transaction failed',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
}; };
const successCallback = results => { const successCallback = results => {
@ -103,12 +105,14 @@ export function doAbandonClaim(txid, nout) {
dispatch(doResolveUri(buildURI({ name, claimId }))); dispatch(doResolveUri(buildURI({ name, claimId })));
dispatch(doFetchClaimListMine()); dispatch(doFetchClaimListMine());
} else { } else {
dispatch(doNotify({ dispatch(
title: 'Transaction failed', doNotify({
message: 'Transaction failed', title: 'Transaction failed',
type: 'error', message: 'Transaction failed',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
} }
}; };

View file

@ -98,12 +98,14 @@ export function doSendDraftTransaction() {
const amount = selectDraftTransactionAmount(state); const amount = selectDraftTransactionAmount(state);
if (balance - amount <= 0) { if (balance - amount <= 0) {
dispatch(doNotify({ dispatch(
title: 'Insufficient credits', doNotify({
message: 'Insufficient credits', title: 'Insufficient credits',
type: 'error', message: 'Insufficient credits',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
return; return;
} }
@ -116,25 +118,29 @@ export function doSendDraftTransaction() {
dispatch({ dispatch({
type: ACTIONS.SEND_TRANSACTION_COMPLETED, type: ACTIONS.SEND_TRANSACTION_COMPLETED,
}); });
dispatch(doNotify({ dispatch(
title: 'Credits sent', doNotify({
message: `You sent ${amount} LBC`, title: 'Credits sent',
type: 'error', message: `You sent ${amount} LBC`,
displayType: ['snackbar', 'toast'], type: 'error',
linkText: 'History', displayType: ['snackbar', 'toast'],
linkTarget: '/wallet' linkText: 'History',
})); linkTarget: '/wallet',
})
);
} else { } else {
dispatch({ dispatch({
type: ACTIONS.SEND_TRANSACTION_FAILED, type: ACTIONS.SEND_TRANSACTION_FAILED,
data: { error: results }, data: { error: results },
}); });
dispatch(doNotify({ dispatch(
title: 'Transaction failed', doNotify({
message: 'Transaction failed', title: 'Transaction failed',
type: 'error', message: 'Transaction failed',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
} }
}; };
@ -143,12 +149,14 @@ export function doSendDraftTransaction() {
type: ACTIONS.SEND_TRANSACTION_FAILED, type: ACTIONS.SEND_TRANSACTION_FAILED,
data: { error: error.message }, data: { error: error.message },
}); });
dispatch(doNotify({ dispatch(
title: 'Transaction failed', doNotify({
message: 'Transaction failed', title: 'Transaction failed',
type: 'error', message: 'Transaction failed',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
}; };
Lbry.wallet_send({ Lbry.wallet_send({
@ -178,12 +186,14 @@ export function doSendSupport(amount, claimId, uri, successCallback, errorCallba
const balance = selectBalance(state); const balance = selectBalance(state);
if (balance - amount <= 0) { if (balance - amount <= 0) {
dispatch(doNotify({ dispatch(
title: 'Insufficient credits', doNotify({
message: 'Insufficient credits', title: 'Insufficient credits',
type: 'error', message: 'Insufficient credits',
displayType: ['modal', 'toast'] type: 'error',
})); displayType: ['modal', 'toast'],
})
);
return; return;
} }