mirror of
https://github.com/catdevnull/transicion-desordenada-diablo
synced 2024-11-29 20:46:19 +00:00
arreglar types en frontend
This commit is contained in:
parent
e1d208b63c
commit
c26cc2d263
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import streamSaver from "streamsaver";
|
import streamSaver from "streamsaver";
|
||||||
import { zData, type Distribution, zError, zDumpMetadata } from "common/schema";
|
import { zData, type Distribution, zDumpError, zDumpMetadata } from "common/schema";
|
||||||
|
|
||||||
export async function downloadFile(
|
export async function downloadFile(
|
||||||
dataPath: string,
|
dataPath: string,
|
||||||
|
@ -73,6 +73,6 @@ export async function fetchErrors(url: string) {
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.filter((line) => !!line)
|
.filter((line) => !!line)
|
||||||
.map((line) => JSON.parse(line))
|
.map((line) => JSON.parse(line))
|
||||||
.map((json) => zError.parse(json));
|
.map((json) => zDumpError.parse(json));
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
$: data = Promise.all([fetchData(url), fetchErrors(url)])
|
$: data = Promise.all([fetchData(url), fetchErrors(url)])
|
||||||
.then(([data, errors]) => ({ data, errors }))
|
.then(([data, errors]) => ({ data, errors }))
|
||||||
.catch(alert);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="mx-auto max-w-3xl">
|
<main class="mx-auto max-w-3xl">
|
||||||
|
@ -102,6 +101,8 @@
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
|
{:catch error}
|
||||||
|
Hubo un error intenando cargar este dataset archivado. <pre>{error}</pre>
|
||||||
{/await}
|
{/await}
|
||||||
</Container>
|
</Container>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
$: data = Promise.all([fetchData(url), fetchErrors(url)])
|
$: data = Promise.all([fetchData(url), fetchErrors(url)])
|
||||||
.then(([data, errors]) => ({ data, errors }))
|
.then(([data, errors]) => ({ data, errors }))
|
||||||
.catch(alert);
|
|
||||||
|
|
||||||
function arreglarHomepageUrl(url: string): string {
|
function arreglarHomepageUrl(url: string): string {
|
||||||
if (!url.startsWith("http://") && !url.startsWith("https://"))
|
if (!url.startsWith("http://") && !url.startsWith("https://"))
|
||||||
|
|
Loading…
Reference in a new issue