Skip to content

Commit f51267b

Browse files
authored
fix(todoist): Fix multiple buttons adding to Todoist task header (#2267)
Closes #2266
1 parent f84b6c5 commit f51267b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/content/todoist.js

+9
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ togglbutton.render(
3535
container: '[data-testid="button-container"]'
3636
});
3737

38+
const existingTogglWrapper = $('.toggl-button-todoist-wrapper');
39+
if (existingTogglWrapper) {
40+
// we need to remove any existing toggl buttons
41+
existingTogglWrapper.replaceChildren(link);
42+
43+
return;
44+
}
45+
3846
const wrapper = document.createElement("div");
47+
wrapper.classList.add('toggl-button-todoist-wrapper');
3948
wrapper.style.display = "flex";
4049
wrapper.style.alignItems = "center";
4150
wrapper.style.justifyContent = "center";

0 commit comments

Comments
 (0)