Skip to content

Commit

Permalink
fix(todoist): Fix multiple buttons adding to Todoist task header (#2267)
Browse files Browse the repository at this point in the history
Closes #2266
  • Loading branch information
pkvach authored Mar 5, 2024
1 parent f84b6c5 commit f51267b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/content/todoist.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ togglbutton.render(
container: '[data-testid="button-container"]'
});

const existingTogglWrapper = $('.toggl-button-todoist-wrapper');
if (existingTogglWrapper) {
// we need to remove any existing toggl buttons
existingTogglWrapper.replaceChildren(link);

return;
}

const wrapper = document.createElement("div");
wrapper.classList.add('toggl-button-todoist-wrapper');
wrapper.style.display = "flex";
wrapper.style.alignItems = "center";
wrapper.style.justifyContent = "center";
Expand Down

0 comments on commit f51267b

Please sign in to comment.