catch claim error on referrer set
This commit is contained in:
parent
1100a07108
commit
7678eedf4d
1 changed files with 8 additions and 8 deletions
|
@ -647,7 +647,14 @@ export function doUserSetReferrer(referrer, shouldClaim) {
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
try {
|
try {
|
||||||
const response = await Lbry.resolve({ urls: [uri] });
|
const response = await Lbry.resolve({ urls: [uri] });
|
||||||
claim = response && response[uri];
|
if (response && response[uri] && !response[uri].error) claim = response && response[uri];
|
||||||
|
if (claim) {
|
||||||
|
if (claim.signing_channel) {
|
||||||
|
referrerCode = claim.signing_channel.permanent_url.replace('lbry://', '');
|
||||||
|
} else {
|
||||||
|
referrerCode = claim.permanent_url.replace('lbry://', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.USER_SET_REFERRER_FAILURE,
|
type: ACTIONS.USER_SET_REFERRER_FAILURE,
|
||||||
|
@ -655,13 +662,6 @@ export function doUserSetReferrer(referrer, shouldClaim) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (claim) {
|
|
||||||
if (claim.signing_channel) {
|
|
||||||
referrerCode = claim.signing_channel.permanent_url.replace('lbry://', '');
|
|
||||||
} else {
|
|
||||||
referrerCode = claim.permanent_url.replace('lbry://', '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!referrerCode) {
|
if (!referrerCode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue