Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelUd committed Jun 6, 2024
1 parent ca765fb commit d9f499f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 1 addition & 4 deletions src/presenter/point-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -167,9 +167,6 @@ export default class PointPresenter {
isMinor ? UpdateType.MINOR : UpdateType.PATCH,
point
);
if (!this.#editPointElement._state.isDisabled) {
this.#replaceToPoint();
}
};

#onEditPointDelete = (point) =>{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d9f499f

Please sign in to comment.