Skip to content

Commit

Permalink
Akmal / feat: re-trigger barrier validation to show any error message…
Browse files Browse the repository at this point in the history
…s hidden that were hidden behind th e action sheet (#17571)

* feat: re-trigger barrier validation to show any error messages hidden that were hidden

* chore: update quill-ui librare

* chore: update quill version

* chore: recreate package-lock

* fix: merge conflict?

* chore: regenerate package-lock and revert pre-commit change in app.tsx

* chore: regenerate package-lock and revert pre-commit change in app.tsx

* fix: remove artificial delay from ServicesErrorSnackbar
  • Loading branch information
akmal-deriv authored Dec 23, 2024
1 parent 1bfe4a9 commit f81e450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import useContractDetails from 'AppV2/Hooks/useContractDetails';
import { checkIsServiceModalError, SERVICE_ERROR } from 'AppV2/Utils/layout-utils';
import { getDisplayedContractTypes } from 'AppV2/Utils/trade-types-utils';

const PROLONGATED_DURATION = 8000;

const ServicesErrorSnackbar = observer(() => {
const {
common: { services_error, resetServicesError },
Expand Down Expand Up @@ -51,7 +49,6 @@ const ServicesErrorSnackbar = observer(() => {
: '48px';
const action_props = {
actionText: localize('View'),
delay: PROLONGATED_DURATION,
onActionClick: () => window.open(getStaticUrl('tnc/trading-terms.pdf', true)),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ const BarrierInput = observer(
onAction: () => {
if (validation_errors.barrier_1.length === 0) {
onClose(true);

// This is a workaround to re-trigger any validation errors that were hidden behind the action sheet
handleOnChange({
target: { name: 'barrier_1', value: barrier_1.replace(/[+-]/g, '') },
});
} else {
setShouldShowError(true);
}
Expand Down

0 comments on commit f81e450

Please sign in to comment.