Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dashuulka committed Jun 10, 2024
1 parent e699b52 commit 0f16466
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/presenter/point-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class PointPresenter {
#mode = Mode.DEFAULT;

constructor({ pointListContainer, destinationsModel, offersModel, onDataChange, onModeChange }) {
if (!pointListContainer || !pointListContainer instanceof Element) {
if ((!pointListContainer || !pointListContainer) instanceof Element) {
throw new Error('Invalid pointListContainer or its element');
}

Expand Down
2 changes: 1 addition & 1 deletion src/presenter/trip-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default class TripPresenter {
await this.#pointsModel.updatePoint(updateType, update);
} catch (err) {
this.#pointPresenters.get(update.id).setAborting();
}}
}}

Check failure on line 199 in src/presenter/trip-presenter.js

View workflow job for this annotation

GitHub Actions / Check

Expected indentation of 10 spaces but found 6
break;
case UserAction.ADD_POINT:
try {
Expand Down
2 changes: 1 addition & 1 deletion src/template/editing-form-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createPointType({ currentType, isDisabled }) {
function createPointOffer({ offers, currentOffers, isDisabled }) {
return currentOffers.offers?.map((offer) => `
<div class="event__offer-selector">
<input class="event__offer-checkbox visually-hidden" ${isDisabled ? "disabled" : ""} data-offer-id="${offer.id}"
<input class="event__offer-checkbox visually-hidden" ${isDisabled ? 'disabled' : ''} data-offer-id="${offer.id}"
id="event-offer-${he.encode(offer.id)}-1" type="checkbox" name="event-offer-${he.encode(offer.title)}" ${offers.includes(offer.id) ? 'checked' : ''}>
<label class="event__offer-label" for="event-offer-${he.encode(offer.id)}">
<span class="event__offer-title">${he.encode(offer.title)}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/trip-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function createViewOfPath(destinations) {
} else {
pathTrip = `${destinations[0]} &mdash; ... &mdash; ${destinations[destinations.length - 1]}`;
}

return pathTrip;
}

Expand Down
6 changes: 3 additions & 3 deletions src/view/editing-form-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ export default class EditPointView extends AbstractStatefulView {
const priceElement = this.element.querySelector('#event-price-1');
const saveButton = this.element.querySelector('.event__save-btn');

if (!destinationElement.value|| dateFromElement.value === dateToElement.value || priceElement.value <= 0
if (!destinationElement.value || dateFromElement.value === dateToElement.value || priceElement.value <= 0
|| !dateFromElement.value || !dateToElement.value) {
saveButton.disabled = true;
saveButton.disabled = true;
} else {
saveButton.disabled = false;
}
}
};

static parsePointToState = (point) => ({
...point,
Expand Down

0 comments on commit 0f16466

Please sign in to comment.