Skip to content

Commit

Permalink
[Fix] Reload state when there is no test
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTainon committed Jul 31, 2023
1 parent 975d5cf commit c871362
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@ function* taskUpdateCurrentTestIdSaga(app: App, {payload}) {
yield* call(createQuickalgoLibrary);
} else if (context) {
log.getLogger('task').debug('task update test', state.task.taskTests, state.task.currentTestId);
if (!(state.task.currentTestId in state.task.taskTests)) {
if (!(state.task.currentTestId in state.task.taskTests) && null !== state.task.currentTestId) {
console.error("Test " + state.task.currentTestId + " does not exist on task ", state.task);
throw "Couldn't update test during replay, check if the replay is using the appropriate task";
}
context.iTestCase = state.task.currentTestId;

if (!payload.withoutContextState) {
const contextState = state.task.taskTests[state.task.currentTestId].contextState;
if (null !== contextState) {
const contextState = state.task.taskTests[state.task.currentTestId]?.contextState;
if (null !== contextState && undefined !== contextState) {
const currentTest = selectCurrentTestData(state);
log.getLogger('task').debug('[taskUpdateCurrentTestIdSaga] reload current test', currentTest, contextState);
context.resetAndReloadState(currentTest, state, contextState);
Expand Down

0 comments on commit c871362

Please sign in to comment.