Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zendesk): Fix broken integration #2350

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/content/zendesk.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,29 @@ setTimeout(() => {
if (document.querySelector('.toggl-button')) {
document.removeChild(elem.querySelector('.toggl-button'));
}
elem.querySelector('[data-side-conversations-anchor-id="1"]').firstChild
.firstChild
.firstChild
.appendChild(link);
try {
elem.querySelector('[data-side-conversations-anchor-id="1"]').firstChild
.firstChild
.firstChild
.appendChild(link);
} catch (error) {
console.error('Toggl Button: Error in rendering', error);
}
}
);
}, 1000);

// Zendesk new UI Sept 2023
setTimeout(() => {
togglbutton.render(
'.ticket-panes-grid-layout.active',
'.ticket-panes-grid-layout[data-is-active="true"]',
{ observe: true },
function (elem) {
const elements = document.querySelectorAll('.ticket-panes-grid-layout:not(.active) .toggl-button')
const elements = document.querySelectorAll('.ticket-panes-grid-layout:not([data-is-active="true"]) .toggl-button')
if(elements.length > 0) {
elements.forEach(element => element.remove())
}
const activeButtonExists = document.querySelector('.ticket-panes-grid-layout.active .toggl-button')
const activeButtonExists = document.querySelector('.ticket-panes-grid-layout[data-is-active="true"] .toggl-button')
if(activeButtonExists) return

let description;
Expand Down
Loading