Skip to content

Commit

Permalink
fix(dixa): add title to conversation id
Browse files Browse the repository at this point in the history
  • Loading branch information
Nederby committed Jan 9, 2022
1 parent 907f593 commit acbbaa3
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/content/dixa.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ togglbutton.render(
{ observe: true },
function (elem) {

const getDescription = () => {
const csid = document.querySelector('.conversation-view__main button span').textContent;
return csid;
const getConversationId = () => {
const csid = document.querySelector('.conversation-view__main button span').textContent;
const title = document.querySelector('.conversation-view__main [class^=conversationHeader__] [class^=headline__] p').textContent;
return `${csid} ${title}`;
};

const getProject = () => {
const subdomain = window.location.host.replace(".dixa.com", "");
return subdomain;
const subdomain = window.location.host.replace(".dixa.com", "");
return subdomain;
}

const getTitle = () => {
const title = document.querySelector('.conversation-view__main [class^=conversationHeader__] [class^=headline__] p').textContent;
return title;
};

// Create timer link element
const link = togglbutton.createTimerLink({
description: getDescription + getTitle,
buttonType: 'minimal',
projectName: getProject,
className: 'dixa'
description: getConversationId,
buttonType: 'minimal',
projectName: getProject,
className: 'dixa'
});

// Add link to element
Expand Down

0 comments on commit acbbaa3

Please sign in to comment.