superchat support
This commit is contained in:
parent
eb37009a98
commit
b511282c35
2 changed files with 24 additions and 20 deletions
18
dist/bundle.es.js
vendored
18
dist/bundle.es.js
vendored
|
@ -3192,7 +3192,7 @@ function doSetDraftTransactionAddress(address) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSendTip(params, isSupport, successCallback, errorCallback) {
|
function doSendTip(params, isSupport, successCallback, errorCallback, shouldNotify = true) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const balance = selectBalance(state);
|
const balance = selectBalance(state);
|
||||||
|
@ -3208,19 +3208,21 @@ function doSendTip(params, isSupport, successCallback, errorCallback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const success = () => {
|
const success = response => {
|
||||||
dispatch(doToast({
|
if (shouldNotify) {
|
||||||
message: shouldSupport ? __('You deposited %amount% LBRY Credits as a support!', { amount: params.amount }) : __('You sent %amount% LBRY Credits as a tip, Mahalo!', { amount: params.amount }),
|
dispatch(doToast({
|
||||||
linkText: __('History'),
|
message: shouldSupport ? __('You deposited %amount% LBRY Credits as a support!', { amount: params.amount }) : __('You sent %amount% LBRY Credits as a tip, Mahalo!', { amount: params.amount }),
|
||||||
linkTarget: '/wallet'
|
linkText: __('History'),
|
||||||
}));
|
linkTarget: '/wallet'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SUPPORT_TRANSACTION_COMPLETED
|
type: SUPPORT_TRANSACTION_COMPLETED
|
||||||
});
|
});
|
||||||
|
|
||||||
if (successCallback) {
|
if (successCallback) {
|
||||||
successCallback();
|
successCallback(response);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@ export function doSetDraftTransactionAddress(address) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function doSendTip(params, isSupport, successCallback, errorCallback) {
|
export function doSendTip(params, isSupport, successCallback, errorCallback, shouldNotify = true) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const balance = selectBalance(state);
|
const balance = selectBalance(state);
|
||||||
|
@ -368,23 +368,25 @@ export function doSendTip(params, isSupport, successCallback, errorCallback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const success = () => {
|
const success = response => {
|
||||||
dispatch(
|
if (shouldNotify) {
|
||||||
doToast({
|
dispatch(
|
||||||
message: shouldSupport
|
doToast({
|
||||||
? __('You deposited %amount% LBRY Credits as a support!', { amount: params.amount })
|
message: shouldSupport
|
||||||
: __('You sent %amount% LBRY Credits as a tip, Mahalo!', { amount: params.amount }),
|
? __('You deposited %amount% LBRY Credits as a support!', { amount: params.amount })
|
||||||
linkText: __('History'),
|
: __('You sent %amount% LBRY Credits as a tip, Mahalo!', { amount: params.amount }),
|
||||||
linkTarget: '/wallet',
|
linkText: __('History'),
|
||||||
})
|
linkTarget: '/wallet',
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.SUPPORT_TRANSACTION_COMPLETED,
|
type: ACTIONS.SUPPORT_TRANSACTION_COMPLETED,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (successCallback) {
|
if (successCallback) {
|
||||||
successCallback();
|
successCallback(response);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue