Skip to content

Commit

Permalink
Add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Quitch committed Mar 13, 2024
1 parent e277712 commit 429784a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions ui/mods/com.quitch.ai-personality-names/names.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ function aiPersonalityNames() {

aiPersonalityNamesLoaded = true;

var replaceHtml = function (htmlClass, file) {
var path = "coui://ui/mods/com.quitch.ai-personality-names/";
$(htmlClass).replaceWith(loadHtml(path + file));
};
try {
var replaceHtml = function (htmlClass, file) {
var path = "coui://ui/mods/com.quitch.ai-personality-names/";
$(htmlClass).replaceWith(loadHtml(path + file));
};

replaceHtml("div.div_player_name.truncate", "playing_names.html");
replaceHtml(
"td.div_name_header.div_spectator_player_info",
"spectating_names.html"
);
replaceHtml("div.div_player_name.truncate", "playing_names.html");
replaceHtml(
"td.div_name_header.div_spectator_player_info",
"spectating_names.html"
);
} catch (e) {
console.error(e);
console.error(JSON.stringify(e));
}
}
aiPersonalityNames();

0 comments on commit 429784a

Please sign in to comment.