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 @@