Skip to content

Commit

Permalink
Merge pull request #18 from Jey-Key30/master
Browse files Browse the repository at this point in the history
  • Loading branch information
keksobot authored Jun 19, 2024
2 parents e072fce + 049185e commit 4829204
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/presenter/board-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import EventListView from '../view/event-list-view.js';
import SortView from '../view/sort-view.js';
import PointPresenter from './point-presenter.js';
import TripInfoView from '../view/trip-info-view.js';
import {sortPointDay, sortPointPrice, sortPointTime} from '../utils.js';
import {sortPointDay, sortPointPrice, sortPointTime, filter, sort} from '../utils.js';
import {FilterType, SortType, UpdateType, UserAction, TimeLimit} from '../const.js';
import FilterPresenter from '../presenter/filter-presenter.js';
import { filter, sort} from '../utils.js';
import NewPointPresenter from '../presenter/new-point-presenter.js';
import MessageView from '../view/message-view.js';
import UiBlocker from '../framework/ui-blocker/ui-blocker.js';
Expand All @@ -30,7 +29,6 @@ export default class BoardPresenter {
#newPointButtonPresenter = null;

#currentSortType = SortType.DAY;
#isCreating = false;

#sortComponent = null;
#tripInfoComponent = null;
Expand All @@ -44,6 +42,7 @@ export default class BoardPresenter {
upperLimit: TimeLimit.UPPER_LIMIT
});

#isCreating = false;
#isLoading = false;

constructor({tripContainer, destinationsModel,
Expand Down Expand Up @@ -130,10 +129,10 @@ export default class BoardPresenter {
#renderFilters = () => {
this.#filterPresenter = new FilterPresenter(
this.#tripFliterElement,
this.#filterModel
this.#filterModel,
);

this.#filterPresenter .init();
this.#filterPresenter.init();
};

#renderMessage = () => {
Expand Down Expand Up @@ -179,7 +178,9 @@ export default class BoardPresenter {
this.#renderLoading();
return;
}
this.#renderTripInfo();
if (this.points.length) {
this.#renderTripInfo();
}
this.#renderSort();
this.#renderPoints();
};
Expand All @@ -189,6 +190,7 @@ export default class BoardPresenter {
remove(this.#messageComponent);
remove(this.#sortComponent);
remove(this.#tripInfoComponent);

this.#sortComponent = null;

if (resetSortType) {
Expand Down
1 change: 1 addition & 0 deletions src/presenter/point-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class PointPresenter {
destroy = () => {
remove(this.#pointComponent);
remove(this.#pointEditComponent);
document.removeEventListener('keydown', this.#escKeyDownHandler);
};

setSaving = () => {
Expand Down

0 comments on commit 4829204

Please sign in to comment.