-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sentry): Fix Sentry integration not working (#2329)
Closes #2328
- Loading branch information
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
'use strict'; | ||
|
||
togglbutton.render('.group-detail:not(.toggl)', { observe: true }, function () { | ||
const errType = $('h3 > span > span').textContent.trim(); | ||
const detail = $('.message').textContent.trim(); | ||
const project = $('.project-select').textContent.trim(); | ||
const description = errType + ': ' + detail; | ||
togglbutton.render('.group-detail:not(.toggl)', { observe: true }, function (elem) { | ||
const pageTitle = $('title').textContent.trim(); | ||
|
||
// Extract the project name from the page title, assuming it's the last part after ' — ' | ||
const pageTitleParts = pageTitle.split(' — '); | ||
const projectName = pageTitleParts.length > 1 ? pageTitleParts[pageTitleParts.length - 1] : ''; | ||
|
||
const link = togglbutton.createTimerLink({ | ||
className: 'sentry', | ||
description: description, | ||
projectName: project | ||
description: pageTitle, | ||
projectName: projectName | ||
}); | ||
|
||
$('.group-detail .nav-tabs').appendChild(link); | ||
const tabListElement = elem.querySelector('ul[role="tablist"]'); | ||
if (tabListElement) { | ||
tabListElement.appendChild(link); | ||
} | ||
}); | ||
|