From 7678eedf4d5b16c7a5e107ae90d5437d83b62d16 Mon Sep 17 00:00:00 2001 From: jessop Date: Wed, 7 Oct 2020 23:20:35 -0400 Subject: [PATCH] catch claim error on referrer set --- ui/redux/actions/user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/redux/actions/user.js b/ui/redux/actions/user.js index 4d8049db1..ac6eb82d7 100644 --- a/ui/redux/actions/user.js +++ b/ui/redux/actions/user.js @@ -647,7 +647,14 @@ export function doUserSetReferrer(referrer, shouldClaim) { if (!claim) { try { 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) { dispatch({ 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) {