From f4c88b5356b84793e8b16a3295c341bed3efa0fb Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 7 Mar 2024 15:21:31 +0200 Subject: [PATCH] ui: Hide 'Accept Bid' btn when not able to accept. --- basicswap/templates/bid.html | 2 +- basicswap/templates/bid_xmr.html | 2 +- basicswap/ui/page_bids.py | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/basicswap/templates/bid.html b/basicswap/templates/bid.html index fc53705..7c518d9 100644 --- a/basicswap/templates/bid.html +++ b/basicswap/templates/bid.html @@ -561,7 +561,7 @@ {% endif %} - {% if data.was_received == 'True' and not edit_bid %} + {% if data.was_received == 'True' and not edit_bid and data.can_accept_bid %}
diff --git a/basicswap/templates/bid_xmr.html b/basicswap/templates/bid_xmr.html index 882addd..b7dbb01 100644 --- a/basicswap/templates/bid_xmr.html +++ b/basicswap/templates/bid_xmr.html @@ -833,7 +833,7 @@ {% endif %} - {% if data.was_received == 'True' and not edit_bid %} + {% if data.was_received == 'True' and not edit_bid and data.can_accept_bid %}
diff --git a/basicswap/ui/page_bids.py b/basicswap/ui/page_bids.py index f45f40f..91eb587 100644 --- a/basicswap/ui/page_bids.py +++ b/basicswap/ui/page_bids.py @@ -108,11 +108,7 @@ def page_bid(self, url_split, post_string): if len(data['addr_from_label']) > 0: data['addr_from_label'] = '(' + data['addr_from_label'] + ')' - - page_data = { - 'bid_states': listBidStates(), - 'bid_actions': [] - } + data['can_accept_bid'] = True if bid.state == BidStates.BID_RECEIVED else False if swap_client.debug_ui: data['bid_actions'] = [(-1, 'None'), ] + listBidActions()