From 39ac2061f2b9bb41ae50f7832892c389232beff4 Mon Sep 17 00:00:00 2001 From: Renato Pozzi Date: Mon, 25 Nov 2024 10:46:54 +0100 Subject: [PATCH] fix(github): add case check for double rendering --- src/content/github.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/content/github.js b/src/content/github.js index 4bba83b7a..c6116cbb8 100644 --- a/src/content/github.js +++ b/src/content/github.js @@ -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') @@ -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,