From 26636a8558dd37cb7f1d94352d728726bb43ea71 Mon Sep 17 00:00:00 2001 From: zigsong Date: Sun, 28 Feb 2021 00:08:51 +0900 Subject: [PATCH] refactor: remove isResultCalculated logic --- src/js/LottoController.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/js/LottoController.js b/src/js/LottoController.js index 696b2b53c3..a9b932c5f6 100644 --- a/src/js/LottoController.js +++ b/src/js/LottoController.js @@ -27,7 +27,6 @@ export default class LottoController { reset() { this.lottos = []; this.purchasedPrice = 0; - this.isResultCalculated = false; this.inputPriceView.show().resetInputPrice(); this.purchasedLottosView.hide().resetToggleSwitch(); @@ -66,18 +65,14 @@ export default class LottoController { } inputNumbersHandler(winningNumbers) { - console.log(winningNumbers); if (!isUniqueWinningNumber(winningNumbers)) { alert(ALERT_MESSAGES.DUPLICATE_NUMS); return; } const lottoProcessor = new LottoProcessor(this.lottos, winningNumbers); - if (!this.isResultCalculated) { - lottoProcessor.checkMatchingNums(); - lottoProcessor.calculateEarningRate(this.purchasedPrice); - this.isResultCalculated = true; - } + lottoProcessor.checkMatchingNums(); + lottoProcessor.calculateEarningRate(this.purchasedPrice); this.winningResultView.showModal( lottoProcessor.rankCounts,