Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix: bug 2356 (#1404)
Browse files Browse the repository at this point in the history
update train dialog validity flags on replay from train dialog list view
  • Loading branch information
LarsLiden committed Dec 5, 2019
1 parent f0af492 commit b0904b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/routes/Apps/App/TrainDialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,21 @@ class TrainDialogs extends React.Component<Props, ComponentState> {
this.props.trainDialogReplayThunkAsync as any,
)

// Get new activities to check for errors or warnings
const teachWithActivities = ((await this.props.fetchActivitiesThunkAsync(this.props.app.appId, newTrainDialog, this.props.user.name, this.props.user.id) as any) as Promise<CLM.TeachWithActivities>)
const replayError = DialogUtils.getMostSevereReplayError((await teachWithActivities).activities)
if (replayError) {
if (replayError.errorLevel === CLM.ReplayErrorLevel.WARNING) {
newTrainDialog.validity = CLM.Validity.WARNING
}
else {
newTrainDialog.validity = CLM.Validity.INVALID
}
}
else {
newTrainDialog.validity = CLM.Validity.VALID
}

await ((this.props.trainDialogReplaceThunkAsync(this.props.app.appId, trainDialog.trainDialogId, newTrainDialog, false) as any) as Promise<void>)

// If user clicks 'Cancel' replay dialogs will be reset
Expand Down

0 comments on commit b0904b7

Please sign in to comment.