mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-06 02:38:11 +01:00
ui: Fix pagination clearing filters
This commit is contained in:
@@ -37,7 +37,7 @@ def page_automation_strategies(self, url_split, post_string):
|
||||
messages = []
|
||||
form_data = self.checkForm(post_string, 'automationstrategies', messages)
|
||||
|
||||
if form_data and have_data_entry(form_data, 'applyfilters'):
|
||||
if form_data and not have_data_entry(form_data, 'clearfilters'):
|
||||
if have_data_entry(form_data, 'sort_by'):
|
||||
sort_by = get_data_entry(form_data, 'sort_by')
|
||||
ensure(sort_by in ['created_at', 'rate'], 'Invalid sort by')
|
||||
@@ -47,7 +47,7 @@ def page_automation_strategies(self, url_split, post_string):
|
||||
ensure(sort_dir in ['asc', 'desc'], 'Invalid sort dir')
|
||||
filters['sort_dir'] = sort_dir
|
||||
|
||||
set_pagination_filters(form_data, filters)
|
||||
set_pagination_filters(form_data, filters)
|
||||
|
||||
formatted_strategies = []
|
||||
for s in swap_client.listAutomationStrategies(filters):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2022 tecnovert
|
||||
# Copyright (c) 2022-2023 tecnovert
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -139,7 +139,7 @@ def page_bids(self, url_split, post_string, sent=False, available=False, receive
|
||||
|
||||
messages = []
|
||||
form_data = self.checkForm(post_string, 'bids', messages)
|
||||
if form_data and have_data_entry(form_data, 'applyfilters'):
|
||||
if form_data and not have_data_entry(form_data, 'clearfilters'):
|
||||
if have_data_entry(form_data, 'sort_by'):
|
||||
sort_by = get_data_entry(form_data, 'sort_by')
|
||||
ensure(sort_by in ['created_at', ], 'Invalid sort by')
|
||||
@@ -160,7 +160,7 @@ def page_bids(self, url_split, post_string, sent=False, available=False, receive
|
||||
with_expired = toBool(get_data_entry(form_data, 'with_expired'))
|
||||
filters['with_expired'] = with_expired
|
||||
|
||||
set_pagination_filters(form_data, filters)
|
||||
set_pagination_filters(form_data, filters)
|
||||
|
||||
bids = swap_client.listBids(sent=sent, filters=filters)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2022 tecnovert
|
||||
# Copyright (c) 2022-2023 tecnovert
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -641,7 +641,7 @@ def page_offers(self, url_split, post_string, sent=False):
|
||||
}
|
||||
messages = []
|
||||
form_data = self.checkForm(post_string, 'offers', messages)
|
||||
if form_data and have_data_entry(form_data, 'applyfilters'):
|
||||
if form_data and not have_data_entry(form_data, 'clearfilters'):
|
||||
filters['coin_from'] = setCoinFilter(form_data, 'coin_from')
|
||||
filters['coin_to'] = setCoinFilter(form_data, 'coin_to')
|
||||
|
||||
@@ -662,7 +662,7 @@ def page_offers(self, url_split, post_string, sent=False):
|
||||
ensure(active_filter in ['any', 'active', 'expired', 'revoked', 'archived'], 'Invalid active filter')
|
||||
filters['active'] = active_filter
|
||||
|
||||
set_pagination_filters(form_data, filters)
|
||||
set_pagination_filters(form_data, filters)
|
||||
|
||||
if filters['sent_from'] == 'only':
|
||||
sent = True
|
||||
|
||||
Reference in New Issue
Block a user