Commit 8492d671 authored by Marek Veselý's avatar Marek Veselý
Browse files

Merge branch '786-fix-ondemandstartalert-cancel' into 'main'

Fixed OnDemandStartAlert cancel + Changed Enter exercise text

Closes #786

See merge request inject/frontend!685
parents 762fd17f 2c8209c7
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ import {
import { secondsFormatter, useWiggle, wiggleClass } from '@inject/shared'
import { useNavigate } from '@tanstack/react-router'
import { useState, type FC } from 'react'
import { TraineeRoute } from '../../routes/_navbar/trainee'
import { TraineeExerciseRoute } from '../../routes/_navbar/trainee/$exerciseId'
import { exerciseAllowedStartInterval } from '../../utils'
import { IntervalInfo } from '../IntervalInfo'
@@ -83,19 +84,20 @@ export const OnDemandStartAlert: FC<OnDemandStartAlertProps> = ({
      intent='warning'
      loading={fetching}
      cancelButtonText='Cancel'
      onCancel={() =>
        // TODO: if only one team, navigate to exercise selection
      onCancel={() => {
        nav({
          to: TraineeExerciseRoute.to,
          to:
            exercise.teams.length > 1
              ? TraineeExerciseRoute.to
              : TraineeRoute.to,
          params: {
            exerciseId: exercise.id,
          },
        })
      }
      }}
    >
      <p>
        You are about to enter and on-demand exercise{' '}
        <strong>{exercise.name}</strong>.
        You are about to enter an exercise <strong>{exercise.name}</strong>.
      </p>
      <p>
        This will start the exercise for your team. Once started, you will not