Skip to content

Commit

Permalink
fix: исправляет обновление фильтров и сортировки
Browse files Browse the repository at this point in the history
  • Loading branch information
lemurlene committed Jan 29, 2025
1 parent ab89a4c commit 6d90a8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/const.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const AUTHORIZATION = 'Basic itdlerjh58258115';
const AUTHORIZATION = 'Basic itdlerjh51158115';
const END_POINT = 'https://22.objects.htmlacademy.pro/big-trip';
const DESTINATIONS_COUNT = 3;
const EVENT_TYPE_DEFAULT = 'flight';
Expand Down
10 changes: 1 addition & 9 deletions src/presenter/board-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ export default class BoardPresenter {
destinationsModel: this.#destinationsModel,
offersModel: this.#offersModel,
onHandleViewAction: this.#handleViewAction,
// onNewPointDestroy: this.#handleNewPointFormClose
onNewPointDestroy: this.#handleNewPointFormClose.bind(this),
onNewPointDestroy: () => this.#handleNewPointFormClose(),
});
this.#pointsModel.addObserver(this.#handleModelEvent);
this.#filterModel.addObserver(this.#handleModelEvent);
Expand Down Expand Up @@ -77,12 +76,10 @@ export default class BoardPresenter {
remove(this.#messageComponent);
this.#messageComponent = null;
}

if (this.#pointsError) {
remove(this.#pointsError);
this.#pointsError = null;
}

this.#clearErrorState();
this.#currentSortType = SortType.DEFAULT.name;
this.#filterModel.setFilter(UpdateType.MAJOR, FilterType.EVERYTHING);
Expand All @@ -99,11 +96,6 @@ export default class BoardPresenter {

#handleNewPointFormClose() {
this.#isCreatingPoint = false;
if (this.#sortComponent) {
remove(this.#sortComponent);
this.#sortComponent = null;
}
this.#renderBoard();
this.#onNewPointDestroy();
}

Expand Down

0 comments on commit 6d90a8a

Please sign in to comment.