Skip to content

Commit

Permalink
Merge pull request #10 from MaksimRozov/master
Browse files Browse the repository at this point in the history
  • Loading branch information
keksobot authored Jun 19, 2024
2 parents aa886f2 + f0bca2b commit 817aae6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PresenterMain from './presenter/presenter-main.js';
import PointsModel from './model/points-model.js';
import FilterModel from './model/filter-model.js';
import FilterPresenter from './presenter/presenter-filter.js';
import PresenterFilter from './presenter/presenter-filter.js';
import PointsApiService from './points-api-service.js';
import PresenterInfoPanel from './presenter/presenter-info-panel.js';
import CreationForm from './view/creation-form.js';
Expand All @@ -28,7 +28,7 @@ const presenter = new PresenterMain({
onNewPointDestroy: handleNewPointButtonClose,
});

const filterPresenter = new FilterPresenter({
const filterPresenter = new PresenterFilter({
filterContainer: filterContainerElement,
filterModel,
pointsModel,
Expand Down
2 changes: 1 addition & 1 deletion src/presenter/presenter-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { filter } from '../utils/filter.js';
import FilterView from '../view/filter-view.js';
import { UpdateType } from '../utils/const.js';

export default class FilterPresenter {
export default class PresenterFilter {
#filterContainer = null;
#filterModel = null;
#pointsModel = null;
Expand Down
16 changes: 9 additions & 7 deletions src/presenter/presenter-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export default class PresenterMain {
this.#presenterNewPoint.init();
}

init() {
this.#renderWaypointList();
}

#handleViewAction = async (actionType, updateType, update) => {
this.#uiBlocker.block();

Expand Down Expand Up @@ -119,11 +123,11 @@ export default class PresenterMain {
this.#pointPresenterMap.get(data.id).init(data);
break;
case UpdateType.MINOR:
this.#clearPoinsList();
this.#clearPointsList();
this.#renderWaypointList();
break;
case UpdateType.MAJOR:
this.#clearPoinsList({ resetSortType: true });
this.#clearPointsList({ resetSortType: true });
this.#renderWaypointList();
break;
case UpdateType.INIT:
Expand All @@ -147,7 +151,7 @@ export default class PresenterMain {
return;
}
this.#currentSortType = sortType;
this.#clearPoinsList();
this.#clearPointsList();
this.#renderWaypointList();
};

Expand All @@ -168,7 +172,7 @@ export default class PresenterMain {
render(this.#listMessageComponent, this.#tripEventsElement);
}

#clearPoinsList(resetSortType = false) {
#clearPointsList(resetSortType = false) {
this.#presenterNewPoint.destroy();
this.#pointPresenterMap.forEach((presenter) => presenter.destroy());
this.#pointPresenterMap.clear();
Expand Down Expand Up @@ -242,7 +246,5 @@ export default class PresenterMain {
}
};

init() {
this.#renderWaypointList();
}

}

0 comments on commit 817aae6

Please sign in to comment.