Skip to content

Commit

Permalink
fix(github): add case check for double rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
askides committed Nov 25, 2024
1 parent b36fbc3 commit 39ac206
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/content/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ togglbutton.render(

// Issue Beta
togglbutton.render(
'[data-testid="issue-viewer-metadata-pane"]:not(.toggl)',
'[data-testid="issue-viewer-metadata-container"]:not(.toggl)',
{ observe: true },
function (elem) {
// This is needed as for this case it will enter in the "Project Page side pane" case.
if ($('[data-testid="side-panel-focus-target"]')) {
return
}

const titleElem = $('[data-testid="issue-title"]')
const projectElem = $('[data-testid="project-title"]')
const existingTag = $('.discussion-sidebar-item.toggl')
Expand Down Expand Up @@ -94,8 +99,6 @@ togglbutton.render(
div.style.paddingLeft = '8px'
div.style.paddingRight = '8px'

console.log(projectElem?.textContent)

const link = togglbutton.createTimerLink({
className: 'github',
description: description,
Expand Down

0 comments on commit 39ac206

Please sign in to comment.