Skip to content

Commit

Permalink
Clear mergeWords array sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgrady committed Oct 23, 2023
1 parent d21119a commit 886f515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/goals/MergeDuplicates/Redux/MergeDupsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export function mergeAll() {
// Merge words.
dispatch(getMergeWords());

const mergeWordsArray = getState().mergeDuplicateGoal.mergeWords;
const mergeWordsArray = [...getState().mergeDuplicateGoal.mergeWords];
dispatch(clearMergeWords());
if (mergeWordsArray.length) {
const parentIds = await backend.mergeWords(mergeWordsArray);
const childIds = [
Expand All @@ -125,7 +126,6 @@ export function mergeAll() {
const completedMerge = { childIds, parentIds };
dispatch(addCompletedMergeToGoal(completedMerge));
await dispatch(asyncUpdateGoal());
dispatch(clearMergeWords());
}
};
}
Expand Down

0 comments on commit 886f515

Please sign in to comment.