removed !result catches

This commit is contained in:
bill bittner 2017-10-18 10:00:24 -07:00
parent 607ca4d98c
commit b4876706fe
2 changed files with 3 additions and 6 deletions

View file

@ -112,7 +112,7 @@ module.exports = {
return new Promise((resolve, reject) => {
db.getLongClaimId(claimName, claimId) // 1. get the long claim id
.then(result => { // 2. get the asset using the long claim id
if (result === NO_CLAIM || !result) {
if (result === NO_CLAIM) {
resolve(NO_CLAIM);
return;
}
@ -129,7 +129,7 @@ module.exports = {
return new Promise((resolve, reject) => {
db.getLongChannelId(channelName, channelId) // 1. get the long channel id
.then(result => { // 2. get the long claim Id
if (result === NO_CHANNEL || !result) {
if (result === NO_CHANNEL) {
resolve(NO_CHANNEL);
return;
}
@ -140,9 +140,6 @@ module.exports = {
if (result === NO_CHANNEL || result === NO_CLAIM) {
resolve(result);
return;
} else if (!result) {
resolve(NO_CLAIM);
return;
}
resolve(getAssetByLongClaimId(result, claimName));
})

View file

@ -73,7 +73,7 @@ function getTopFreeClaimIdByClaimName (name) {
.then(result => {
switch (result.length) {
case 0:
return resolve(null);
return resolve(NO_CLAIM);
default:
return resolve(result[0].claimId);
}