Skip to content

Commit

Permalink
delete no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMalyuga committed Dec 19, 2024
1 parent 819ceff commit 2c723bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 2 additions & 5 deletions js/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ function showSuccessAlert() {
addAlertElement(successUploadContainer, successButton);
}

function showErrorAlert(cb) {
return function () {
addAlertElement(errorUploadContainer, errorButton);
cb();
};
function showErrorAlert() {
addAlertElement(errorUploadContainer, errorButton);
}

function showDataAlert() {
Expand Down
3 changes: 2 additions & 1 deletion js/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function applyEffectLevel(image, effectName) {
}

function updateSliderOptions(effectName) {
const {filter, ...sliderParameters} = effects[effectName];
const sliderParameters = {...effects[effectName]};
delete sliderParameters['filter'];
switch (effectName) {
case 'marvin': {
updateSlider(sliderBar, ...Object.values(sliderParameters));
Expand Down
7 changes: 5 additions & 2 deletions js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ form.addEventListener('submit', (evt) => {
if (isValid) {
blockSubmitButton();
sendData(() => {
unBlockSubmitButton();
showSuccessAlert();
unBlockSubmitButton();
closeForm();
}, showErrorAlert(unBlockSubmitButton()), new FormData(evt.target));
}, () => {
showErrorAlert();
unBlockSubmitButton();
}, new FormData(evt.target));
}
});

Expand Down

0 comments on commit 2c723bd

Please sign in to comment.