From d9f499f5584cb89c08cbc288e091df6be5f4772a Mon Sep 17 00:00:00 2001 From: PavelUd Date: Thu, 6 Jun 2024 07:01:05 +0500 Subject: [PATCH] quick fix --- src/const.js | 4 ++-- src/presenter/point-presenter.js | 5 +---- src/utils/common.js | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/const.js b/src/const.js index 92a97f2..ec2ea20 100644 --- a/src/const.js +++ b/src/const.js @@ -102,9 +102,9 @@ export const POINT_EMPTY = { offers: [], type: DEFAULT_TYPE, }; - +const MSEC_IN_SEC = 1000; const SEC_IN_MIN = 60; const MIN_IN_HOUR = 60; const HOUR_IN_DAY = 24; -export const MSEC_IN_HOUR = MIN_IN_HOUR * SEC_IN_MIN; +export const MSEC_IN_HOUR = MIN_IN_HOUR * SEC_IN_MIN * MSEC_IN_SEC; export const MSEC_IN_DAY = HOUR_IN_DAY * MSEC_IN_HOUR; diff --git a/src/presenter/point-presenter.js b/src/presenter/point-presenter.js index a0783ff..15c7183 100644 --- a/src/presenter/point-presenter.js +++ b/src/presenter/point-presenter.js @@ -116,7 +116,7 @@ export default class PointPresenter { setAborting = () => { if(this.#mode === Mode.DEFAULT){ - this.#editPointElement.shake(); + this.#pointElement.shake(); } else { this.#editPointElement.shake(this.#resetFormState); @@ -167,9 +167,6 @@ export default class PointPresenter { isMinor ? UpdateType.MINOR : UpdateType.PATCH, point ); - if (!this.#editPointElement._state.isDisabled) { - this.#replaceToPoint(); - } }; #onEditPointDelete = (point) =>{ diff --git a/src/utils/common.js b/src/utils/common.js index ceb60cc..9f28852 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -48,7 +48,7 @@ export const isMinorUpdate = (pointA, pointB) => export const getDateDiff = (pointA, pointB) => dayjs(pointA.dateFrom).diff(dayjs(pointB.dateFrom)); -export const getPriceDiff = (pointA, pointB) => pointA.basePrice - pointB.basePrice; +export const getPriceDiff = (pointA, pointB) => pointB.basePrice - pointA.basePrice; export const getDurationDiff = (pointA, pointB) => dayjs(pointB.dateTo).diff(dayjs(pointB.dateFrom)) - dayjs(pointA.dateTo).diff(dayjs(pointA.dateFrom));