From 40eac5d01f90c5759d1102583d83f71210df34c9 Mon Sep 17 00:00:00 2001 From: blek Date: Sun, 3 Sep 2023 22:37:52 +1000 Subject: [PATCH] ensure that targets are in dictionary --- src/dictionary.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dictionary.ts b/src/dictionary.ts index 0659281..adbf4d7 100644 --- a/src/dictionary.ts +++ b/src/dictionary.ts @@ -1,7 +1,12 @@ +import targets from "./targets"; + let dict: string[] = []; let dict_loaded = false; export async function loadDict(onprogress?: {(data: { loaded: number, total: number }): void}) { + + if (dict_loaded) return dict; + const req = await fetch('/dictionary.csv', { cache: 'force-cache' }); @@ -24,6 +29,7 @@ export async function loadDict(onprogress?: {(data: { loaded: number, total: num } })) dict = data.split(','); + dict = [ ...targets, ...dict ]; dict_loaded = true; }