Skip to content

Commit

Permalink
Merge pull request #2046 from kaloudis/send-receive-hide-buttons
Browse files Browse the repository at this point in the history
Send/receive: hide select buttons when loading
  • Loading branch information
kaloudis authored Mar 11, 2024
2 parents 09967e0 + 5ee1680 commit c296122
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 48 deletions.
93 changes: 48 additions & 45 deletions views/PaymentRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1045,52 +1045,55 @@ export default class PaymentRequest extends React.Component<
</ScrollView>
</View>

{!!pay_req && BackendUtils.supportsLightningSends() && (
<View style={{ bottom: 10 }}>
<View style={styles.button}>
<Button
title={localeString(
'views.PaymentRequest.payInvoice'
)}
icon={
lightningReadyToSend
? {
name: 'send',
size: 25
}
: undefined
}
onPress={() => {
if (isZaplocker)
LnurlPayStore.broadcastAttestation();
this.sendPayment({
payment_request: paymentRequest,
amount: satAmount
? satAmount.toString()
: undefined,
max_parts: enableMultiPathPayment
? maxParts
: null,
max_shard_amt: enableMultiPathPayment
? maxShardAmt
: null,
fee_limit_sat: isLnd
? feeLimitSat
: null,
max_fee_percent: isCLightning
? maxFeePercentFormatted
: null,
outgoing_chan_id: outgoingChanId,
last_hop_pubkey: lastHopPubkey,
amp: enableAmp,
timeout_seconds: timeoutSeconds
});
}}
disabled={!lightningReadyToSend}
/>
{!!pay_req &&
!loading &&
BackendUtils.supportsLightningSends() && (
<View style={{ bottom: 10 }}>
<View style={styles.button}>
<Button
title={localeString(
'views.PaymentRequest.payInvoice'
)}
icon={
lightningReadyToSend
? {
name: 'send',
size: 25
}
: undefined
}
onPress={() => {
if (isZaplocker)
LnurlPayStore.broadcastAttestation();
this.sendPayment({
payment_request: paymentRequest,
amount: satAmount
? satAmount.toString()
: undefined,
max_parts: enableMultiPathPayment
? maxParts
: null,
max_shard_amt:
enableMultiPathPayment
? maxShardAmt
: null,
fee_limit_sat: isLnd
? feeLimitSat
: null,
max_fee_percent: isCLightning
? maxFeePercentFormatted
: null,
outgoing_chan_id: outgoingChanId,
last_hop_pubkey: lastHopPubkey,
amp: enableAmp,
timeout_seconds: timeoutSeconds
});
}}
disabled={!lightningReadyToSend}
/>
</View>
</View>
</View>
)}
)}
</Screen>
);
}
Expand Down
5 changes: 2 additions & 3 deletions views/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1285,9 +1285,8 @@ export default class Receive extends React.Component<
posStatus === 'active' ? null : haveInvoice ? (
<ClearButton />
) : (
BackendUtils.supportsAddressTypeSelection() && (
<SettingsButton />
)
BackendUtils.supportsAddressTypeSelection() &&
!creatingInvoice && <SettingsButton />
)
}
navigation={navigation}
Expand Down

0 comments on commit c296122

Please sign in to comment.