aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--webAO/client/fetchLists.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/webAO/client/fetchLists.ts b/webAO/client/fetchLists.ts
index bf4fd1b..704c889 100644
--- a/webAO/client/fetchLists.ts
+++ b/webAO/client/fetchLists.ts
@@ -21,10 +21,6 @@ export const fetchBackgroundList = async () => {
export const fetchCharacterList = async () => {
try {
- const chardata = await request(`${AO_HOST}characters.json`);
- const char_array = JSON.parse(chardata);
- // the try catch will fail before here when there is no file
-
const char_select = <HTMLSelectElement>(
document.getElementById("client_iniselect")
);
@@ -32,6 +28,10 @@ export const fetchCharacterList = async () => {
char_select.add(new Option("Custom", "0"));
+ const chardata = await request(`${AO_HOST}characters.json`);
+ const char_array = JSON.parse(chardata);
+ // the try catch will fail before here when there is no file
+
char_array.forEach((character: string) => {
char_select.add(new Option(character));
});
@@ -43,10 +43,6 @@ export const fetchCharacterList = async () => {
export const fetchEvidenceList = async () => {
try {
- const evidata = await request(`${AO_HOST}evidence.json`);
- const evi_array = JSON.parse(evidata);
- // the try catch will fail before here when there is no file
-
const evi_select = <HTMLSelectElement>(
document.getElementById("evi_select")
);
@@ -54,6 +50,10 @@ export const fetchEvidenceList = async () => {
evi_select.add(new Option("Custom", "0"));
+ const evidata = await request(`${AO_HOST}evidence.json`);
+ const evi_array = JSON.parse(evidata);
+ // the try catch will fail before here when there is no file
+
evi_array.forEach((evi: string) => {
evi_select.add(new Option(evi));
});