- commit
- 940cb09060122ed6b3900923f5e93299e2b2d150
- parent
- 1bbf5ed232df1d4478af78d5bc7cd174fbb3984b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-10-26 18:57
clear winState for each game
Diffstat
| M | src/logic.js | 2 | +- |
| M | src/template.js | 4 | ++-- |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/logic.js b/src/logic.js
@@ -57,7 +57,7 @@ export const calculateNextGen = function(state) {
57 57
58 58 // Scenariostuff
59 59 if (state.game.winCondition) {
60 -1 state.winState = state.game.winCondition(state);
-1 60 state.game.winState = state.game.winCondition(state);
61 61 }
62 62 };
63 63
diff --git a/src/template.js b/src/template.js
@@ -64,9 +64,9 @@ const renderMenu = function(state) {
64 64 };
65 65
66 66 const renderWinState = function(state) {
67 -1 if (state.winState) {
-1 67 if (state.game.winState) {
68 68 return h('p', {}, 'You have won');
69 -1 } else if (state.winState === false) {
-1 69 } else if (state.game.winState === false) {
70 70 return h('p', {}, 'You have lost');
71 71 }
72 72 };