From d80ed97169ad405f0811a239bb35fc1f6cefa68d Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Sat, 11 May 2024 16:10:40 -0400 Subject: [PATCH] Custom route hints: hide selection if hints disabled --- views/Receive.tsx | 82 +++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/views/Receive.tsx b/views/Receive.tsx index 83193023f..6197d642f 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -2473,47 +2473,51 @@ export default class Receive extends React.Component< )} - {BackendUtils.isLNDBased() && ( - - (this.hopPickerRef = ref) - } - onValueChange={(channels) => { - this.setState({ - selectedRouteHintChannels: - channels - }); - }} - onCancel={() => { - if ( - !selectedRouteHintChannels?.length - ) { - setRouteHintMode( + {BackendUtils.isLNDBased() && + routeHints && ( + + (this.hopPickerRef = + ref) + } + onValueChange={( + channels + ) => { + this.setState({ + selectedRouteHintChannels: + channels + }); + }} + onCancel={() => { + if ( + !selectedRouteHintChannels?.length + ) { + setRouteHintMode( + RouteHintMode.Automatic + ); + } + }} + title={localeString( + 'views.Receive.customRouteHints' + )} + ChannelsStore={ + this.props.ChannelsStore + } + UnitsStore={UnitsStore} + containerStyle={{ + display: + routeHintMode === RouteHintMode.Automatic - ); + ? 'none' + : 'flex' + }} + clearOnTap={false} + selectionMode={'multiple'} + selectedChannels={ + selectedRouteHintChannels } - }} - title={localeString( - 'views.Receive.customRouteHints' - )} - ChannelsStore={ - this.props.ChannelsStore - } - UnitsStore={UnitsStore} - containerStyle={{ - display: - routeHintMode === - RouteHintMode.Automatic - ? 'none' - : 'flex' - }} - clearOnTap={false} - selectionMode={'multiple'} - selectedChannels={ - selectedRouteHintChannels - } - /> - )} + /> + )} {BackendUtils.supportsAMP() && !lspIsActive && (