Compare commits
No commits in common. "4973f7ac4ab1966fe18c9f480e1a03d09f6026f9" and "404f29e6ea0e1b944a8c79c2a1472ddc565360f2" have entirely different histories.
4973f7ac4a
...
404f29e6ea
5 changed files with 2 additions and 86 deletions
|
@ -9,7 +9,6 @@
|
|||
ListGroupItem,
|
||||
} from '@sveltestrap/sveltestrap';
|
||||
|
||||
import { hasDownloaded } from '$lib/stores/downloaded.js';
|
||||
import FileSize from './FileSize.svelte';
|
||||
|
||||
export let files = [];
|
||||
|
@ -28,8 +27,8 @@
|
|||
</CardBody>
|
||||
<ListGroup flush class="border-secondary">
|
||||
{#each files as file, index}
|
||||
<ListGroupItem tag="a" href={file.path} target={(file.name.endsWith(".txt") || file.name.endsWith(".xml") || file.name.endsWith(".jpg") || file.name.endsWith(".png") || file.name.endsWith(".pdf"))?"_blank":"_self"} class="d-flex" action on:click={() => hasDownloaded.update((u) => {u[file.path] = true; return u;})}>
|
||||
<h1 class="me-3" class:text-info={!$hasDownloaded[file.path]}>
|
||||
<ListGroupItem tag="a" href={file.path} target={(file.name.endsWith(".txt") || file.name.endsWith(".xml") || file.name.endsWith(".jpg") || file.name.endsWith(".png") || file.name.endsWith(".pdf"))?"_blank":"_self"} class="d-flex">
|
||||
<h1 class="me-3">
|
||||
<Icon name="arrow-down-circle" />
|
||||
</h1>
|
||||
<div style="min-width: 0">
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
import { my } from '$lib/stores/my.js';
|
||||
import { settings } from '$lib/stores/settings.js';
|
||||
import { submissions } from '$lib/stores/submissions.js';
|
||||
import { timeouted, waitDiff, waitInProgress } from '$lib/wait.js';
|
||||
|
||||
import DateFormat from './DateFormat.svelte';
|
||||
|
@ -37,20 +36,6 @@
|
|||
message = "";
|
||||
last_submission = JSON.parse(JSON.stringify(responses));
|
||||
|
||||
submissions.update((u) => {
|
||||
for (const k in last_submission.flags) {
|
||||
u.flags[k] = last_submission.flags[k];
|
||||
}
|
||||
|
||||
for (const k in last_submission.mcqs) {
|
||||
u.mcqs[k] = last_submission.mcqs[k];
|
||||
}
|
||||
|
||||
for (const k in last_submission.justifications) {
|
||||
u.justifications[k] = last_submission.justifications[k];
|
||||
}
|
||||
})
|
||||
|
||||
if ($my && $my.team_id === 0) {
|
||||
let allGoodResponse = true;
|
||||
for (const f in flags) {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
import { my } from '$lib/stores/my.js';
|
||||
import { settings } from '$lib/stores/settings.js';
|
||||
import { submissions } from '$lib/stores/submissions.js';
|
||||
|
||||
export { className as class };
|
||||
let className = '';
|
||||
|
@ -248,15 +247,6 @@
|
|||
title="Flag trouvé à {flag.found}"
|
||||
value={value}
|
||||
>
|
||||
{:else if $submissions && $submissions.flags && $submissions.flags[flag.id]}
|
||||
<input
|
||||
class="form-control is-valid"
|
||||
disabled
|
||||
id="sol_{flag.type}{flag.id}_0"
|
||||
type="text"
|
||||
title="Flag trouvé à {flag.found}"
|
||||
value={$submissions.flags[flag.id]}
|
||||
>
|
||||
{:else}
|
||||
<Icon
|
||||
name="check"
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
import { writable } from 'svelte/store';
|
||||
|
||||
function createDownloadedStore() {
|
||||
let init = { };
|
||||
try {
|
||||
if (window.localStorage && window.localStorage.getItem("downloadedStore")) {
|
||||
init = JSON.parse(window.localStorage.getItem("downloadedStore"));
|
||||
}
|
||||
} catch {
|
||||
init = { };
|
||||
}
|
||||
|
||||
const { subscribe, set, update } = writable(init);
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
update: (u) => {
|
||||
update(u);
|
||||
if (window.localStorage) localStorage.setItem("downloadedStore", JSON.stringify(init));
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export const hasDownloaded = createDownloadedStore();
|
|
@ -1,33 +0,0 @@
|
|||
import { writable } from 'svelte/store';
|
||||
|
||||
function createSubmissionsStore() {
|
||||
let init = {
|
||||
flags: { },
|
||||
mcqs: { },
|
||||
justifications: { },
|
||||
};
|
||||
try {
|
||||
if (window.localStorage && window.localStorage.getItem("submissionsStore")) {
|
||||
init = JSON.parse(window.localStorage.getItem("submissionsStore"));
|
||||
}
|
||||
} catch {
|
||||
init = {
|
||||
flags: { },
|
||||
mcqs: { },
|
||||
justifications: { },
|
||||
};
|
||||
}
|
||||
|
||||
const { subscribe, set, update } = writable(init);
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
update: (u) => {
|
||||
update(u);
|
||||
if (window.localStorage) localStorage.setItem("submissionsStore", JSON.stringify(init));
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export const submissions = createSubmissionsStore();
|
Reference in a new issue