Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error hitting back from Merge Duplicates #725

Closed
johnthagen opened this issue Sep 18, 2020 · 2 comments
Closed

Error hitting back from Merge Duplicates #725

johnthagen opened this issue Sep 18, 2020 · 2 comments
Labels
bug Something isn't working goal: MergeDup

Comments

@johnthagen
Copy link
Collaborator

  1. Create a new project
  2. Add two new words in Universe (with audio)
  3. Data Cleanup
  4. Merge Duplicates
  5. (Browser back button)
×
Unhandled Rejection (TypeError): Cannot read property 'goalType' of undefined
updateStepData
C:/Users/User/GitHub/TheCombine/src/components/GoalTimeline/GoalsActions.tsx:165
  162 | }
  163 | 
  164 | export function updateStepData(goal: Goal): Goal {
> 165 |   switch (goal.goalType) {
  166 |     case GoalType.MergeDups: {
  167 |       let currentGoalData: MergeDupData = JSON.parse(
  168 |         JSON.stringify(goal.data as MergeDupData)
View compiled
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:219
  216 |   state: GoalHistoryState
  217 | ): Promise<void> {
  218 |   return new Promise((resolve, reject) => {
> 219 |     let updatedGoal = updateStepData(goal);
  220 |     dispatch(updateGoal(updatedGoal));
  221 |     let indexInHistory: number = getIndexInHistory(state.history, goal);
  222 |     addStepToGoal(state.history[indexInHistory], indexInHistory);
View compiled
updateStep
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:218
  215 |   goal: Goal,
  216 |   state: GoalHistoryState
  217 | ): Promise<void> {
> 218 |   return new Promise((resolve, reject) => {
  219 |     let updatedGoal = updateStepData(goal);
  220 |     dispatch(updateGoal(updatedGoal));
  221 |     let indexInHistory: number = getIndexInHistory(state.history, goal);
View compiled
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:195
  192 |    let goal: Goal = historyState.history[historyState.history.length - 1];
  193 | 
  194 |    // Push the current step into the history state and load the data.
> 195 |    await updateStep(dispatch, goal, historyState).then(() => {
      | ^  196 |      historyState = getState().goalsState.historyState;
  197 |      goal = historyState.history[historyState.history.length - 1];
  198 |      if (goal.currentStep < goal.numSteps) {
View compiled
▶ 2 stack frames were collapsed.
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/components/GoalTimeline/GoalsActions.tsx:152
  149 |        goal.currentStep = 0;
  150 |        goal.steps = [];
  151 | 
> 152 |        await dispatch(refreshWords());
      | ^  153 | 
  154 |        break;
  155 |      case GoalType.CreateCharInv:
@johnthagen johnthagen added bug Something isn't working goal: MergeDup labels Sep 18, 2020
@imnasnainaec
Copy link
Collaborator

Related: #393

@imnasnainaec
Copy link
Collaborator

Resolved (probably in commits # 1004-1028).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working goal: MergeDup
Projects
None yet
Development

No branches or pull requests

2 participants