ui: Before start, display some standalone exercices
This commit is contained in:
parent
122e919daf
commit
9e6a03c681
@ -19,7 +19,7 @@
|
|||||||
import { my } from '$lib/stores/my.js';
|
import { my } from '$lib/stores/my.js';
|
||||||
import { teams } from '$lib/stores/teams.js';
|
import { teams } from '$lib/stores/teams.js';
|
||||||
import { myThemes, themes } from '$lib/stores/mythemes.js';
|
import { myThemes, themes } from '$lib/stores/mythemes.js';
|
||||||
import { settings } from '$lib/stores/settings.js';
|
import { settings, time } from '$lib/stores/settings.js';
|
||||||
import { themesStore } from '$lib/stores/themes.js';
|
import { themesStore } from '$lib/stores/themes.js';
|
||||||
|
|
||||||
// Override theme color
|
// Override theme color
|
||||||
@ -35,11 +35,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($themesStore["0"] && !$themesStore["0"].locked && $themesStore["0"].exercices) {
|
if ($themesStore["0"] && !$themesStore["0"].locked && $themesStore["0"].exercices) {
|
||||||
|
let nb_ex_max = tmpitems.length;
|
||||||
let i = 1;
|
let i = 1;
|
||||||
let j = 0;
|
let j = 0;
|
||||||
for (j = $themesStore["0"].exercices.length - 1; j >= 0 && i < tmpitems.length; j--) {
|
for (j = $themesStore["0"].exercices.length - 1; j >= 0 && i < tmpitems.length; j--) {
|
||||||
if ($my && $my.team_id && !$my.exercices[$themesStore["0"].exercices[j].id])
|
if ($my && $my.team_id && !$my.exercices[$themesStore["0"].exercices[j].id]) {
|
||||||
continue;
|
// Only apply after start
|
||||||
|
if (!($time.startIn && j < nb_ex_max && j < $settings.unlockedStandaloneExercices))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
tmpitems.splice(i, 0, {id: tmpitems.length, theme: $themesStore["0"], exercice: $themesStore["0"].exercices[j]});
|
tmpitems.splice(i, 0, {id: tmpitems.length, theme: $themesStore["0"], exercice: $themesStore["0"].exercices[j]});
|
||||||
i += 2;
|
i += 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user