Skip to content

Commit

Permalink
Revert racing features fixes.
Browse files Browse the repository at this point in the history
URL change is reverted.

This reverts commits 9656832
and faa2a39.

# Conflicts:
#	extension/changelog.json
  • Loading branch information
Sashank999 committed Jun 25, 2024
1 parent 6ddf497 commit e9c2f85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"date": false,
"logs": {
"features": [{ "message": "Show total value of an opened supply pack.", "contributor": "Conrado" }],
"fixes": [{ "message": "Fixing racing features.", "contributor": "TheFoxMan" }],
"fixes": [{ "message": "Fixing (and then reverting) racing features.", "contributor": "TheFoxMan" }],
"changes": [],
"removed": []
}
Expand Down
4 changes: 2 additions & 2 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "TornTools",
"version": "7.2.4",
"version": "7.3.0",
"description": "Several tools for Torn.",
"icons": { "16": "resources/images/icon_16.png", "48": "resources/images/icon_48.png", "128": "resources/images/icon_128.png" },
"action": { "default_title": "TornTools", "default_popup": "pages/popup/popup.html", "default_icon": "resources/images/icon_128.png" },
Expand Down Expand Up @@ -611,7 +611,7 @@
"run_at": "document_end"
},
{
"matches": ["https://www.torn.com/loader.php?sid=racing*", "https://www.torn.com/page.php?sid=racing*"],
"matches": ["https://www.torn.com/loader.php?sid=racing*"],
"css": ["scripts/features/racing-upgrades/ttRacingUpgrades.css"],
"js": ["scripts/features/car-win-percentage/ttCarWinPercentage.js", "scripts/features/racing-upgrades/ttRacingUpgrades.js"],
"run_at": "document_end"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
addXHRListener(({ detail: { page, xhr } }) => {
if (
feature.enabled() &&
(page === "loader" || page === "page") &&
page === "loader" &&
(xhr.responseURL.includes("tab=parts") || xhr.responseURL.includes("tab=cars") || xhr.responseURL.includes("race_carlist.js"))
)
addPercentage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
addXHRListener(async ({ detail: { page, xhr, uri } }) => {
if (!feature.enabled()) return;

if ((page === "page" || page === "loader") && uri) {
if (page === "loader" && uri) {
const sid = uri.sid;
if (sid !== "racing") return;

Expand All @@ -33,7 +33,7 @@
car.classList.add("tt-modified");
car.addEventListener("click", () => requireElement(".pm-categories-wrap").then(showUpgrades));
}
} else if (page === "page" || page === "loader2") {
} else if (page === "loader2") {
const params = new URLSearchParams(xhr.requestBody);

const sid = params.get("sid");
Expand All @@ -45,7 +45,7 @@
const confirm = params.get("confirm");
if (confirm !== "1") return;

setTimeout(resetUpgrades, 1000);
setTimeout(resetUpgrades, 250);
}
});
}
Expand Down

0 comments on commit e9c2f85

Please sign in to comment.