aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleASS.ts
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2026-02-07 23:01:25 +0100
committerDavid Skoland <davidskoland@gmail.com>2026-02-07 23:01:25 +0100
commit9c68a1afcf178a86063f094b96471fa73531bd9a (patch)
treec05945ddd1048e4016fdb2f78285d6124d3348f9 /webAO/packets/handlers/handleASS.ts
parentf26d35429e66ddcdd02c10f57b315b0f02b4add2 (diff)
Use setAOhost return value instead of stale AO_HOST import
setAOhost now returns the current AO_HOST so handleASS can use the freshly set value rather than the import captured before the update. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'webAO/packets/handlers/handleASS.ts')
-rw-r--r--webAO/packets/handlers/handleASS.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/webAO/packets/handlers/handleASS.ts b/webAO/packets/handlers/handleASS.ts
index 1ecfd04..092e4f9 100644
--- a/webAO/packets/handlers/handleASS.ts
+++ b/webAO/packets/handlers/handleASS.ts
@@ -1,4 +1,4 @@
-import { setAOhost, AO_HOST } from "../../client/aoHost";
+import { setAOhost } from "../../client/aoHost";
import { client } from "../../client";
/**
@@ -6,7 +6,7 @@ import { client } from "../../client";
* @param {Array} args packet arguments
*/
export const handleASS = (args: string[]) => {
- if (args[1] !== "None") setAOhost(args[1]);
+ const host = args[1] !== "None" ? setAOhost(args[1]) : args[1];
// Re-apply playerlist icon srcs that were set before AO_HOST was known
const iconExt = client.charicon_extensions[0] || ".png";
@@ -18,7 +18,7 @@ export const handleASS = (args: string[]) => {
`#client_playerlist_entry${playerID} img`
);
if (img) {
- img.src = `${AO_HOST}characters/${encodeURI(char.name.toLowerCase())}/char_icon${iconExt}`;
+ img.src = `${host}characters/${encodeURI(char.name.toLowerCase())}/char_icon${iconExt}`;
}
}
}