fixed double send coins... if user clicked twice.
This commit is contained in:
@@ -521,10 +521,12 @@ sendNotifSchema.statics.updateStatusAndDescr = async function(myrecnotif, onlysa
|
||||
typeidsearch = shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ;
|
||||
newstatus = shared_consts.CircuitsNotif.STATUS_COINS_REFUSED;
|
||||
} else if (myrecnotif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_COINS_ACCEPTED_SENT) {
|
||||
typeidsearch = shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ_SENT;
|
||||
if (myrecnotif.paramsObj.extrarec.hasOwnProperty('notifIdToUpdate'))
|
||||
idnotiftosearch = myrecnotif.paramsObj.extrarec.notifIdToUpdate;
|
||||
newstatus = shared_consts.CircuitsNotif.STATUS_COINS_ACCEPTED_SENT;
|
||||
} else if (myrecnotif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_COINS_REFUSED_SENT) {
|
||||
typeidsearch = shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ_SENT;
|
||||
if (myrecnotif.paramsObj.extrarec.hasOwnProperty('notifIdToUpdate'))
|
||||
idnotiftosearch = myrecnotif.paramsObj.extrarec.notifIdToUpdate;
|
||||
newstatus = shared_consts.CircuitsNotif.STATUS_COINS_REFUSED_SENT;
|
||||
@@ -598,8 +600,8 @@ sendNotifSchema.statics.checkIfCoinsAlreadySent = async function(notifId) {
|
||||
const status = await SendNotif.getStatus(notifId);
|
||||
|
||||
if (status !== null) {
|
||||
return (status === shared_consts.CircuitsNotif.STATUS_ACCEPTED) ||
|
||||
(status === shared_consts.CircuitsNotif.STATUS_REFUSED);
|
||||
return (status === shared_consts.CircuitsNotif.STATUS_COINS_ACCEPTED) ||
|
||||
(status === shared_consts.CircuitsNotif.STATUS_COINS_REFUSED);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user