Skip to content

Commit

Permalink
Merge pull request #841 from JustaPenguin/time-attack-non-premium-fix
Browse files Browse the repository at this point in the history
prevent time attack from restricting sessions for non premium users
  • Loading branch information
cj123 authored Apr 14, 2020
2 parents 731bfe6 + d59607e commit 55b9196
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/server-manager/typescript/src/javascript/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,14 @@ class RaceSetup {
}

setTimeAttack() {
let timeAttack = $("#TimeAttack").bootstrapSwitch('state');
let $timeAttack = $("#TimeAttack");

if (!$timeAttack.length > 0) {
// don't init time attack at all on non-premium builds
return;
}

let timeAttackEnabled = $timeAttack.bootstrapSwitch('state');

let $loopModeSwitch = $("#LoopMode");

Expand All @@ -373,7 +380,7 @@ class RaceSetup {
let $raceSwitch = $("#Race\\.Enabled");
let $bookingSwitch = $("#Booking\\.Enabled");

if (timeAttack) {
if (timeAttackEnabled) {
// disable sessions other than practice, force loop mode on
$loopModeSwitch.bootstrapSwitch('state', true);
$loopModeSwitch.bootstrapSwitch('disabled', true);
Expand Down

0 comments on commit 55b9196

Please sign in to comment.