Skip to content

Commit

Permalink
Refactor out unnecessary conditional
Browse files Browse the repository at this point in the history
onComplete is not optional so these if blocks can be consolidated
  • Loading branch information
scottybollinger committed Dec 1, 2020
1 parent 887c195 commit 3d79dd3
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ export const IndexingStatusLogic = kea<MakeLogicType<IndexingStatusValues, Index
const response = (await HttpLogic.values.http.get(statusPath)) as IIndexingStatus;
if (response.percentageComplete >= 100) {
clearInterval(pollingInterval);
}
actions.setIndexingStatus(response);
if (response.percentageComplete >= 100 && onComplete) {
onComplete(response.numDocumentsWithErrors);
}
actions.setIndexingStatus(response);
} catch (e) {
flashAPIErrors(e);
}
Expand Down

0 comments on commit 3d79dd3

Please sign in to comment.