Skip to content

Commit

Permalink
fix(youtrack): Fix YouTrack issue element selectors
Browse files Browse the repository at this point in the history
Closes #2319
  • Loading branch information
pkvach committed Sep 16, 2024
1 parent 362be1f commit 8a5d384
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/content/youtrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ togglbutton.render(
'div[data-test="issue-container"]:not(.toggl)',
{ observe: true },
function (elem) {
console.log('Toggl Button: Reporter info not found.')
const reporterInfo = elem.querySelector('span[data-test="reporter-info"]');
const reporterInfo = elem.querySelector('[data-test="reporter-info"]');
if (reporterInfo === null) {
console.log('Toggl Button: Reporter info not found.')
return;
}
const reporterInfoContainer = reporterInfo.parentElement;

const issueIdElem = reporterInfoContainer.querySelector('a[href*="issue/"] > span');
const issueIdElem = reporterInfoContainer.querySelector('a[href*="issue/"]');
const issueId = issueIdElem ? issueIdElem.textContent.trim() : "";

const issueTitleElem = elem.querySelector('h1');
Expand Down

0 comments on commit 8a5d384

Please sign in to comment.