Skip to content

Commit

Permalink
[WEBREL] / Ameerul / WEBREL-2858 Order unsuccessful error modal showi…
Browse files Browse the repository at this point in the history
…ng in glitch when trying to place order again after market rate change (#15814)

* fix: glitch showing fluctuation modal on confirm, use error message from BE for slippage

* fix: removed commented out code

* chore: wrap create new order with localize
  • Loading branch information
ameerul-deriv committed Jun 28, 2024
1 parent 537830f commit 4a54a5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const BuySellModal = () => {
});
} else {
submitForm();
hideModal({ should_hide_all_modals: true });
}
};

Expand Down
8 changes: 3 additions & 5 deletions packages/p2p/src/stores/buy-sell-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ export default class BuySellStore extends BaseStore {
general_store.showModal({
key: 'ErrorModal',
props: {
error_message:
'We’re unable to create your order because the market rate has moved too much. Please try creating a new order.',
error_modal_button_text: 'Create new order',
error_message: message,
error_modal_button_text: localize('Create new order'),
error_modal_title: (
<Text weight='bold'>
<Localize i18n_default_text='Order unsuccessful' />
Expand All @@ -226,8 +225,7 @@ export default class BuySellStore extends BaseStore {
},
});
} else {
if (!general_store.isCurrentModal('BuySellModal'))
general_store.showModal({ key: 'BuySellModal', props: {} });
general_store.showModal({ key: 'BuySellModal', props: {} });
this.form_props.setErrorMessage(message);
this.setFormErrorCode(code);
}
Expand Down

0 comments on commit 4a54a5d

Please sign in to comment.