Skip to content

Commit

Permalink
fix: console error on edit ad where payment method is disabled from bo (
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed Feb 7, 2023
1 parent c54c71c commit bd4493b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/p2p/src/components/my-ads/edit-ad-form.jsx
Expand Up @@ -101,8 +101,10 @@ const EditAdForm = () => {
const selected_payment_method_values = [];
payment_method_names?.forEach(pm => {
my_profile_store.getPaymentMethodValue(pm);
selected_payment_method_values.push(my_profile_store.payment_method_value);
my_ads_store.payment_method_names.push(my_profile_store.payment_method_value);
if (my_profile_store.payment_method_value) {
selected_payment_method_values.push(my_profile_store.payment_method_value);
my_ads_store.payment_method_names.push(my_profile_store.payment_method_value);
}
});
setSelectedMethods(selected_payment_method_values);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/p2p/src/stores/my-profile-store.js
Expand Up @@ -403,7 +403,7 @@ export default class MyProfileStore extends BaseStore {
pm => pm[1].display_name === payment_method
);

this.setPaymentMethodValue(method[0][0]);
this.setPaymentMethodValue(method[0]?.[0]);
return this.payment_method_value;
}

Expand Down

0 comments on commit bd4493b

Please sign in to comment.