fix: myClaims undefined in some cases where isSupport is false
This commit is contained in:
parent
6da0697e3f
commit
73f10d488d
4 changed files with 24 additions and 4 deletions
2
dist/bundle.es.js
vendored
2
dist/bundle.es.js
vendored
|
@ -2020,7 +2020,7 @@ function doSendTip(amount, claimId, isSupport, successCallback, errorCallback) {
|
|||
const balance = selectBalance(state);
|
||||
const myClaims = selectMyClaimsRaw(state);
|
||||
|
||||
const shouldSupport = isSupport || myClaims.find(claim => claim.claim_id === claimId);
|
||||
const shouldSupport = isSupport || (myClaims ? myClaims.find(claim => claim.claim_id === claimId) : false);
|
||||
|
||||
if (balance - amount <= 0) {
|
||||
dispatch(doToast({
|
||||
|
|
4
dist/flow-typed/Lbry.js
vendored
4
dist/flow-typed/Lbry.js
vendored
|
@ -66,7 +66,7 @@ declare type VersionResponse = {
|
|||
declare type BalanceResponse = {
|
||||
available: string,
|
||||
reserved: string,
|
||||
reserved_subtotals: ? {
|
||||
reserved_subtotals: ?{
|
||||
claims: string,
|
||||
supports: string,
|
||||
tips: string,
|
||||
|
@ -205,7 +205,7 @@ declare type LbryTypes = {
|
|||
comment_list: (params: {}) => Promise<CommentListResponse>,
|
||||
comment_create: (params: {}) => Promise<CommentCreateResponse>,
|
||||
// Wallet utilities
|
||||
account_balance: (params: {}) => Promise<string>,
|
||||
account_balance: (params: {}) => Promise<BalanceResponse>,
|
||||
account_decrypt: (prams: {}) => Promise<boolean>,
|
||||
account_encrypt: (params: {}) => Promise<boolean>,
|
||||
account_unlock: (params: {}) => Promise<boolean>,
|
||||
|
|
20
dist/flow-typed/lbryURI.js
vendored
Normal file
20
dist/flow-typed/lbryURI.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
// @flow
|
||||
declare type LbryUrlObj = {
|
||||
// Path and channel will always exist when calling parseURI
|
||||
// But they may not exist when code calls buildURI
|
||||
isChannel?: boolean,
|
||||
path?: string,
|
||||
streamName?: string,
|
||||
streamClaimId?: string,
|
||||
channelName?: string,
|
||||
channelClaimId?: string,
|
||||
primaryClaimSequence?: number,
|
||||
secondaryClaimSequence?: number,
|
||||
primaryBidPosition?: number,
|
||||
secondaryBidPosition?: number,
|
||||
|
||||
// Below are considered deprecated and should not be used due to unreliableness with claim.canonical_url
|
||||
claimName?: string,
|
||||
claimId?: string,
|
||||
contentName?: string,
|
||||
};
|
|
@ -217,7 +217,7 @@ export function doSendTip(amount, claimId, isSupport, successCallback, errorCall
|
|||
const balance = selectBalance(state);
|
||||
const myClaims = selectMyClaimsRaw(state);
|
||||
|
||||
const shouldSupport = isSupport || myClaims.find(claim => claim.claim_id === claimId);
|
||||
const shouldSupport = isSupport || (myClaims ? myClaims.find(claim => claim.claim_id === claimId) : false);
|
||||
|
||||
if (balance - amount <= 0) {
|
||||
dispatch(
|
||||
|
|
Loading…
Add table
Reference in a new issue