Skip to content

Commit

Permalink
Ameerul /Bug 80766 Search payment method filter on buy/sell page does…
Browse files Browse the repository at this point in the history
… not work as expected (#6891)

* wrapped filterModalResults in observer as it wasnt rerendering

* changed debounce time back to 1000

* fixed filtered payment methods when closing modal
  • Loading branch information
ameerul-deriv committed Nov 17, 2022
1 parent 8a34556 commit 8c1e247
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import { useStores } from 'Stores';
import PageReturn from 'Components/page-return/page-return.jsx';

const FilterModalHeader = () => {
const { buy_sell_store } = useStores();
const { buy_sell_store, my_profile_store } = useStores();

if (buy_sell_store.show_filter_payment_methods) {
return (
<PageReturn
onClick={() => buy_sell_store.setShowFilterPaymentMethods(false)}
onClick={() => {
buy_sell_store.setShowFilterPaymentMethods(false);
my_profile_store.setSearchTerm('');
my_profile_store.setSearchResults([]);
}}
page_title={localize('Payment methods')}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const FilterModal = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const FilterModalResult = () => {
const FilterModalResult = observer(() => {
if (buy_sell_store.is_filter_modal_loading) return <Loading is_fullscreen={false} />;
else if (my_profile_store.search_term) {
if (!my_profile_store.search_results || my_profile_store.search_results.length > 0) {
Expand Down Expand Up @@ -77,7 +77,7 @@ const FilterModal = () => {
/>
);
});
};
});

return (
<Modal
Expand Down

0 comments on commit 8c1e247

Please sign in to comment.