From 321a576533f6f4b94c83178668a51f8a7293e7d7 Mon Sep 17 00:00:00 2001 From: pjaudiomv <34245618+pjaudiomv@users.noreply.github.com> Date: Sun, 18 Feb 2024 10:05:00 -0500 Subject: [PATCH] update type safety and css (#22) --- src/lib/DataConverter.svelte | 131 ++++++++++++++++++++--------------- 1 file changed, 75 insertions(+), 56 deletions(-) diff --git a/src/lib/DataConverter.svelte b/src/lib/DataConverter.svelte index 5fdf50b..c0e1af9 100644 --- a/src/lib/DataConverter.svelte +++ b/src/lib/DataConverter.svelte @@ -3,16 +3,16 @@ import { writable } from 'svelte/store'; import { fetchData, exportCSV, exportKML } from './DataUtils'; - const processing = writable(false); - const errorMessage = writable(''); - const loadingText = writable(''); - let query = ''; - let csvDownloadUrl = ''; - let kmlDownloadUrl = ''; + const processing = writable(false); + const errorMessage = writable(''); + const loadingText = writable(''); + let query: string = ''; + let csvDownloadUrl: string = ''; + let kmlDownloadUrl: string = ''; let interval: number | undefined; function startLoadingAnimation() { - let dots = ''; + let dots: string = ''; interval = setInterval(() => { if (dots.length < 4) { dots += '.'; @@ -24,7 +24,9 @@ } function stopLoadingAnimation() { - clearInterval(interval); + if (interval !== undefined) { + clearInterval(interval); + } loadingText.set(''); } @@ -97,96 +99,113 @@