Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaWithSalt authored Jun 9, 2024
2 parents bd11e3b + 7771efb commit 334b85a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/presenter/waypoints-list-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ export default class WaypointsListPresenter {
filteredPoints.forEach((waypoint) => this.#renderWaypoint(waypoint));
}

#renderInfo() {
const route = getRoute(
this.#sortWaypoints(SORTING_TYPES.DAY, this.waypointsModel.getWaypoints()),
this.waypointsModel.destinations
);
this.#infoComponent = new InfoView({
route: route.route,
routeDates: route.routeDates,
totalPrice: getTotalPrice(this.waypointsModel.getWaypoints(), this.waypointsModel.offers),
});

render(this.#infoComponent, this.#mainContainer, RenderPosition.AFTERBEGIN);
}

reset() {
this.#waypointPresenters.forEach((waypointPresenter) => waypointPresenter.destroy());
this.#waypointPresenters = [];
Expand Down

0 comments on commit 334b85a

Please sign in to comment.