From 0880896513688ee81a94c1597811d50e425b0b59 Mon Sep 17 00:00:00 2001 From: Andrew Kemp Date: Wed, 13 May 2020 14:57:29 -0400 Subject: [PATCH] If game errors on first call. --- src/app/store/game/game.reducer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/store/game/game.reducer.ts b/src/app/store/game/game.reducer.ts index c93a7d5..b37105b 100644 --- a/src/app/store/game/game.reducer.ts +++ b/src/app/store/game/game.reducer.ts @@ -45,7 +45,7 @@ export const reducer = createReducer( ); -export const getHasMatchHistory = (state: State) => state.gameHistory.length > 0; +export const getHasMatchHistory = (state: State) => state.gameHistory.filter(h => h.result !== 'error').length > 0; export const getMatchHistory = (state: State) => state.gameHistory.filter(h => h.result !== 'error'); export const getGameStatus = (state: State) => state.gameStatus; export const getRecentMatchHistory = (state: State) => state.gameHistory.slice(-1).pop();