diff --git a/src/app/app.tsx b/src/app/app.tsx index 96b28df..aae2e90 100644 --- a/src/app/app.tsx +++ b/src/app/app.tsx @@ -57,6 +57,9 @@ export class App extends React.Component = ( // all the cases handled. switch (action.type) { case ActionNames.InitUserName: - return { ...state, username: action.payload.userName }; + return { ...initialState, username: action.payload.userName }; case ActionNames.InitRepo: { const clonedAppState = new Map(state.repoStateMap); @@ -44,6 +64,9 @@ export const reducer: Reducer = ( noCommits: { status: FilterStatus.waiting, }, + aggregated: { + status: FilterStatus.waiting, + }, }, }); return { ...state, repoStateMap: clonedAppState }; @@ -54,14 +77,17 @@ export const reducer: Reducer = ( JSON.stringify(clonedAppState.get(action.payload.repoName)) ) as | { - filterState: RepoFilterState; - } + filterState: RepoFilterState; + } | undefined; if (clonedRepoState !== undefined) { clonedRepoState.filterState[action.payload.filterStep] = action.payload.filterState; + clonedRepoState.filterState[FilterSteps.aggregated].status = + calculateAggregateStatus(clonedRepoState.filterState); + clonedAppState.set(action.payload.repoName, clonedRepoState); return { ...state, repoStateMap: clonedAppState }; } else {