Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
fix: при взятии карточки закрывать модальное окно
Browse files Browse the repository at this point in the history
closes #38
  • Loading branch information
standy committed Jun 23, 2017
2 parents 1ea6fcf + c6ed91e commit 6293403
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions source/js/auto/Auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export default class Auto {
}

if (settingsValues.autohelpEnergy && energy > settingsValues.autohelpEnergyGreaterValue && (
(settingsValues.autohelpEnergyFight && isFight) ||
(settingsValues.autohelpEnergyRest && isRest) ||
(settingsValues.autohelpEnergyWalk && actionType === ACTION_TYPE_NAMES.walk) ||
(settingsValues.autohelpEnergyTradeMed && (actionType === ACTION_TYPE_NAMES.trade || actionType === ACTION_TYPE_NAMES.energy))
)) {
(settingsValues.autohelpEnergyFight && isFight) ||
(settingsValues.autohelpEnergyRest && isRest) ||
(settingsValues.autohelpEnergyWalk && actionType === ACTION_TYPE_NAMES.walk) ||
(settingsValues.autohelpEnergyTradeMed && (actionType === ACTION_TYPE_NAMES.trade || actionType === ACTION_TYPE_NAMES.energy))
)) {
godHelp(`Накопилась энергия: ${energy}`);

return;
Expand All @@ -70,7 +70,11 @@ export default class Auto {
$('.pgf-get-card-button a').trigger('click');
return;
}

const hasModal = $('.modal-header') && ($('.pgf-dialog-title').text() === 'Вы получаете новую карту!')
if (hasModal) {
$('.pgf-dialog-button-0').trigger('click')
return;
}
return;


Expand All @@ -82,7 +86,7 @@ export default class Auto {
sendNotify(`The Tale Extended - ${storage.heroName}`, {
tag: 'autohelp',
body:
`Сработала автоматическая помощь
`Сработала автоматическая помощь
${msg}
Текущее действие: ${ACTION_TYPE_TEXTS[actionType]}`,
addTime: true,
Expand Down

0 comments on commit 6293403

Please sign in to comment.