aboutsummaryrefslogtreecommitdiff
path: root/webAO/client/fetchLists.ts
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2025-09-03 08:39:19 +0200
committerstonedDiscord <Tukz@gmx.de>2025-09-03 08:39:19 +0200
commit3162071cb27510954dde918af629ed5d75deb583 (patch)
tree2e9e81b5942f50ac6e470049b0fe3093a4eb4672 /webAO/client/fetchLists.ts
parent8e46e304f4defc7f9f4eb01922812b28a8585307 (diff)
get list of extensions to try from host
Diffstat (limited to 'webAO/client/fetchLists.ts')
-rw-r--r--webAO/client/fetchLists.ts14
1 files changed, 11 insertions, 3 deletions
diff --git a/webAO/client/fetchLists.ts b/webAO/client/fetchLists.ts
index 2489c97..2aff60a 100644
--- a/webAO/client/fetchLists.ts
+++ b/webAO/client/fetchLists.ts
@@ -50,8 +50,6 @@ 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
-
evi_array.forEach((evi: string) => {
evi_select.add(new Option(evi));
});
@@ -64,8 +62,18 @@ export const fetchManifest = async () => {
try {
const manifestdata = await request(`${AO_HOST}manifest.txt`);
client.manifest = manifestdata.split(/\r\n|\n\r|\n|\r/);
- // the try catch will fail before here when there is no file
} catch (err) {
console.warn("there was no manifest.txt file");
}
};
+
+export const fetchExtensions = async () => {
+ try {
+ const extensiondata = await request(`${AO_HOST}extensions.json`);
+ const allextensions = JSON.parse(extensiondata);
+ client.charicon_extensions = allextensions.charicon_extensions|| [".png", ".webp"];
+ client.emote_extensions = allextensions.emote_extensions || [".gif", ".png", ".apng", ".webp", ".webp.static"];
+ } catch (err) {
+ console.warn("there was no extensions.json file");
+ }
+};