aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2022-11-17 23:29:17 +0100
committerstonedDiscord <Tukz@gmx.de>2022-11-17 23:29:17 +0100
commit14dd6bf87f05a411b4eadcb4f6f37f726341a800 (patch)
tree062dbd7cfc04ad3a012f10418ba408ebf76f94f2 /webAO
parent2b78887579ba24355936ae75f912c55343bf0d0b (diff)
still have custom if request fails
Diffstat (limited to 'webAO')
-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));
});