From 9b8b0e71e907507df45a6626f56da653a383f016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?=
Date: Fri, 18 Nov 2022 13:58:10 -0300
Subject: [PATCH] Refactor variable names
---
src/lib/FileViewer.svelte | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/lib/FileViewer.svelte b/src/lib/FileViewer.svelte
index 71ac1ea..4457208 100644
--- a/src/lib/FileViewer.svelte
+++ b/src/lib/FileViewer.svelte
@@ -5,16 +5,16 @@
import { filterFileRequirements } from "../utils/filterFileRequirements";
- let files;
- let filesRendered = false;
- let filesRejected;
+ let acceptedFiles;
+ let rejectedFiles;
+ let isAcceptedFilesRendered = false;
const fileRequirements = {
supportedFormats: [".pes"],
maxSize: 700000,
};
const onSubmit = () => {
- filesRendered = true;
+ isAcceptedFilesRendered = true;
};
const onDrop = (evt) => {
@@ -22,16 +22,16 @@
};
const onChange = (evt) => {
- files = null;
- filesRendered = false;
+ acceptedFiles = null;
+ isAcceptedFilesRendered = false;
const changedFiles = evt.dataTransfer
? evt.dataTransfer.files
: evt.target.files;
const results = filterFileRequirements(changedFiles, fileRequirements);
- files = results.accepted;
- filesRejected = results.rejected;
+ acceptedFiles = results.accepted;
+ rejectedFiles = results.rejected;
};
const onClick = () => {
@@ -58,7 +58,7 @@
-{#if filesRendered}
-
+{#if isAcceptedFilesRendered}
+
{:else}
-
-
+
+
{/if}