Skip to content

Commit 80f039f

Browse files
twrichardsandrew-nowak
authored andcommitted
correct the link on the sIndicator roundel added in #13442
1 parent 2698ed3 commit 80f039f

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

dotcom-rendering/src/client/sIndicator.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const displaySIndicatorRoundel = (
2121
const roundelElement =
2222
document.getElementById(overallRoundelElementId) ??
2323
(() => {
24-
const newElem = document.createElement('div');
24+
const newElem = document.createElement('a');
2525
newElem.id = overallRoundelElementId;
2626
document.body.appendChild(newElem);
2727
return newElem;
@@ -45,6 +45,16 @@ const displaySIndicatorRoundel = (
4545
roundelElement.style.width = '40px';
4646
roundelElement.style.height = '40px';
4747

48+
roundelElement.style.cursor = 'pointer';
49+
roundelElement.setAttribute(
50+
'href',
51+
window.location.hostname === 'localhost'
52+
? 'http://localhost:4200/sIndicator'
53+
: `https://syndication.${window.location.hostname
54+
.replace('m.', '')
55+
.replace('www.', '')}/sIndicator`,
56+
);
57+
4858
switch (status) {
4959
case 'loading':
5060
roundelElement.title = 'Checking syndication status...';
@@ -66,15 +76,6 @@ const displaySIndicatorRoundel = (
6676
'There was an error checking syndication status. Click to check your CAPI key...';
6777
roundelElement.style.backgroundColor = 'yellow';
6878
roundelElement.textContent = '⚠️';
69-
roundelElement.style.cursor = 'pointer';
70-
roundelElement.addEventListener(
71-
'click',
72-
() =>
73-
(window.location.href =
74-
window.location.hostname === 'localhost'
75-
? 'http://localhost:4200/sIndicator'
76-
: `https://syndication.${window.location.hostname}/sIndicator`),
77-
);
7879
break;
7980
}
8081
};

0 commit comments

Comments
 (0)