[Задача 13121] Поправил сокрытие карточки с опечаткой в случае ошибки

parent b8624760
......@@ -147,22 +147,18 @@ export default class Typo extends Component {
/**
* Hides typo card
*/
hideTypoCard(completeFunc) {
$(`#typo-${this.typo.id}`).animate({
marginLeft: "3000px",
opacity: 0
}, 500, completeFunc);
}
// hideTypoCard() {
// $(`#typo-${this.typo.id}`).animate({
// marginLeft: "3000px",
// opacity: 0
// }, 500);
// }
applyCorrection = () => {
this.hideTypoCard(() => {
this.acceptCallback(this.typo.correctedText);
});
let success = this.acceptCallback(this.typo.correctedText);
};
declineCorrection = () => {
this.hideTypoCard(() => {
this.declineCallback();
});
let success = this.declineCallback();
};
}
\ No newline at end of file
......@@ -34,13 +34,15 @@ export default class TypoList extends Component {
this.state.resolvedTypos.push(typoId)
this._decrementSiteTyposCount();
this.forceUpdate();
return;
return true;
}
alertify.error(response.message);
return false;
})
.fail(() => {
alertify.error("Ошибка исправления опечатки, попробуйте позже");
return false;
})
}
......@@ -55,12 +57,15 @@ export default class TypoList extends Component {
.done(() => {
alertify.success(`Опечатка ${typoId} была отклонена`);
this.state.resolvedTypos.push(typoId)
this.state.resolvedTypos.push(typoId);
this._decrementSiteTyposCount();
this.forceUpdate();
return true;
})
.fail(() => {
alertify.error("Ошибка исправления опечатки, попробуйте позже");
return false;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment