mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-25 04:52:05 +00:00
fix: upload status
This commit is contained in:
parent
9142262892
commit
546a0047c0
1 changed files with 5 additions and 2 deletions
|
|
@ -10,22 +10,25 @@
|
|||
export let title: string;
|
||||
export let filetype: 'PDF' | 'ZIP';
|
||||
export let filesize: string;
|
||||
export let fileType: number = 0;
|
||||
export let fileType: number;
|
||||
|
||||
let status: Status;
|
||||
|
||||
$: if ($submissionProgress) {
|
||||
status = getStatus();
|
||||
console.log('type' + fileType + ' status: ' + status);
|
||||
}
|
||||
|
||||
const getStatus = (): Status => {
|
||||
console.log($submissionProgress);
|
||||
switch ($submissionProgress.status) {
|
||||
case UploadStatus.None:
|
||||
return 'missing';
|
||||
case UploadStatus.Some:
|
||||
if (!$submissionProgress.files!.some(code => code === fileType)) {
|
||||
if ($submissionProgress.files!.some(code => code === fileType)) {
|
||||
return 'uploaded';
|
||||
}
|
||||
return 'missing';
|
||||
case UploadStatus.All:
|
||||
return 'uploaded';
|
||||
case UploadStatus.Submitted:
|
||||
|
|
|
|||
Loading…
Reference in a new issue