Skip to content

Commit

Permalink
Prevent MutationObserver error when removedNodes is empty (#836)
Browse files Browse the repository at this point in the history
* Prevent MutationObserver error when removedNodes is empty on faction page

* Added contribution information
  • Loading branch information
MOBermejo authored Feb 16, 2025
1 parent 614be1a commit e5acedd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{ "message": "Change layout of preferences page on mobiles.", "contributor": "TheFoxMan" },
{ "message": "Correctly list Love Juice cooldown.", "contributor": "DeKleineKobini" },
{ "message": "Option to highlight items in Bazaars that have a ccost less than the vendor price.", "contributor": "TravisTheTechie" },
{ "message": "Update 'Painleth Dentitht' mission hint.", "contributor": "DeKleineKobini" }
{ "message": "Update 'Painleth Dentitht' mission hint.", "contributor": "DeKleineKobini" },
{ "message": "Prevent error on the faction page when member list is modified", "contributor": "MOBermejo" }
],
"removed": []
}
Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/content/factions/ttFactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const isOwnFaction = getSearchParameters().get("step") === "your";
if (records.length > 1) return;

for (const record of records) {
if (!record.removedNodes?.[0].matches("#iconTray")) continue;
if (!record.removedNodes?.[0]?.matches("#iconTray")) continue;

const oldIconsCount = record.removedNodes?.[0].children.length;
const newIconsCount = record.addedNodes?.[0].children.length;
Expand Down
7 changes: 7 additions & 0 deletions extension/scripts/global/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ const TEAM = [
torn: 3549588,
color: "firebrick",
},
{
name: "MOBermejo",
title: "Developer",
core: false,
torn: 3385879,
color: "#DAA520",
}
];

const CONTRIBUTORS = TEAM.filter(({ title, color }) => title.includes("Developer") || color).reduce(
Expand Down

0 comments on commit e5acedd

Please sign in to comment.