1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

fix: show announce url origin in inspector tier list (#5382)

This commit is contained in:
Charles Kerr 2023-04-12 20:44:26 -05:00 committed by GitHub
parent c3038d8ed7
commit 8dbf40613a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -739,13 +739,14 @@ export class Inspector extends EventTarget {
tier_div.classList.add('tier-list-row', index % 2 ? 'odd' : 'even');
let element = document.createElement('div');
let site = '';
try {
site = new URL(tracker.announce).origin;
} catch {
site = [tracker.sitename || tracker.host || tracker.announce];
}
element.classList.add('tier-list-tracker');
setTextContent(
element,
`${tracker.sitename || tracker.host || tracker.announce} - tier ${
tracker.tier + 1
}`
);
setTextContent(element, `${site} - tier ${tracker.tier + 1}`);
element.setAttribute('title', tracker.announce);
tier_div.append(element);