Skip to content

Commit

Permalink
Fix BT trackers not censoring on compact view
Browse files Browse the repository at this point in the history
  • Loading branch information
JovannMC committed Aug 23, 2024
1 parent d1f31fc commit e13aa84
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/static/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,26 +1066,23 @@ function addEventListeners() {
devices.forEach((device) => {
const deviceNameElement = device.querySelector("#device-name");
const deviceIDElement = device.querySelector("#device-id");

if (!deviceNameElement || !deviceIDElement) return;

const deviceName = deviceNameElement.textContent;
const deviceID = deviceIDElement.textContent;

if (deviceName.includes("HaritoraX") && deviceName === device.id) {
deviceNameElement.textContent = "HaritoraX-XXXXXX";
}

if (deviceID.includes("HaritoraX")) {
deviceIDElement.textContent = "HaritoraX-XXXXXX";
}

if (deviceName.includes("HaritoraXW") && deviceName === device.id) {
deviceNameElement.textContent = "HaritoraXW-XXXXXX";

if (deviceNameElement) {
const deviceName = deviceNameElement.textContent;
if (deviceName.includes("HaritoraX") && deviceName === device.id) {
deviceNameElement.textContent = "HaritoraX-XXXXXX";
} else if (deviceName.includes("HaritoraXW") && deviceName === device.id) {
deviceNameElement.textContent = "HaritoraXW-XXXXXX";
}
}

if (deviceID.includes("HaritoraXW")) {
deviceIDElement.textContent = "HaritoraXW-XXXXXX";

if (deviceIDElement) {
const deviceID = deviceIDElement.textContent;
if (deviceID.includes("HaritoraX")) {
deviceIDElement.textContent = "HaritoraX-XXXXXX";
} else if (deviceID.includes("HaritoraXW")) {
deviceIDElement.textContent = "HaritoraXW-XXXXXX";
}
}
});
} else {
Expand All @@ -1095,11 +1092,14 @@ function addEventListeners() {
const deviceNameElement = device.querySelector("#device-name");
const deviceIDElement = device.querySelector("#device-id");
const originalDeviceName = settings.trackers?.[device.id]?.name ?? device.id;

if (!deviceNameElement || !deviceIDElement) return;

deviceNameElement.textContent = originalDeviceName;
deviceIDElement.textContent = device.id;

if (deviceNameElement) {
deviceNameElement.textContent = originalDeviceName;
}

if (deviceIDElement) {
deviceIDElement.textContent = device.id;
}
});
}
});
Expand Down

0 comments on commit e13aa84

Please sign in to comment.