frontend: Keep the flag card displayed if not marked as solved

+ Ensure its hide when validated in presence of labels

Fixes: https://gitlab.cri.epita.fr/ing/majeures/srs/fic/server/-/issues/31
This commit is contained in:
nemunaire 2023-11-05 12:06:44 +01:00
parent 84a771a4a2
commit c70eb7f582
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ function createMyStore() {
if (my.exercices[k].flags) {
let nb = 0;
for (let j in my.exercices[k].flags) {
if (!my.exercices[k].flags[j].found)
if (my.exercices[k].flags[j].type && !my.exercices[k].flags[j].found)
nb += 1;
}
my.exercices[k].non_found_flags = nb;

View File

@ -229,7 +229,7 @@
{/if}
</Col>
<Col lg="6" class="mb-5">
{#if $my.exercices[$current_exercice.id].flags && $my.exercices[$current_exercice.id].non_found_flags > 0 && !solved[$current_exercice.id]}
{#if $my.exercices[$current_exercice.id].flags && ($my.exercices[$current_exercice.id].non_found_flags > 0 || !$my.exercices[$current_exercice.id].solved_rank) && !solved[$current_exercice.id]}
{#if $current_theme.locked}
<Card class="border-danger mb-2">
<CardHeader class="bg-black text-light">