Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
eliottvincent committed Apr 10, 2024
1 parent 13c8e67 commit 13487ae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import CrispTrigger from "./trigger";
import CrispSession from "./session";

export {
EventsColors,
EventsColors
} from "./session";

import CrispChat from "./chat";
Expand All @@ -34,7 +34,7 @@ declare global {
var CRISP_TOKEN_ID: string;
var CRISP_RUNTIME_CONFIG: any;
var CRISP_COOKIE_DOMAIN: string;
var CRISP_COOKIE_EXPIRE: number
var CRISP_COOKIE_EXPIRE: number;
}
/* eslint-enable no-var, @typescript-eslint/no-explicit-any */

Expand Down Expand Up @@ -104,9 +104,9 @@ class Crisp {
trigger: CrispTrigger;

constructor() {
this.chat = new CrispChat(this);
this.chat = new CrispChat(this);
this.session = new CrispSession(this);
this.user = new CrispUser(this);
this.user = new CrispUser(this);
this.message = new CrispMessage(this);
this.trigger = new CrispTrigger(this);
}
Expand Down
30 changes: 16 additions & 14 deletions src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,25 @@ export default class CrispUser {
setCompany(name: string, data: CompanyData) {
const _payload: CompanyData = {};

if (data && data.url) {
_payload.url = data.url;
}
if (data) {
if (data.url) {
_payload.url = data.url;
}

if (data && data.description) {
_payload.description = data.description;
}
if (data.description) {
_payload.description = data.description;
}

if (data && data.employment) {
_payload.employment = [
(data.employment as CompanyDataEmployment).title
];
if (data.employment) {
_payload.employment = [
(data.employment as CompanyDataEmployment).title
];

if ((data.employment as CompanyDataEmployment).role) {
_payload.employment.push(
(data.employment as CompanyDataEmployment).role!
);
if ((data.employment as CompanyDataEmployment).role) {
_payload.employment.push(
(data.employment as CompanyDataEmployment).role!
);
}
}
}

Expand Down

0 comments on commit 13487ae

Please sign in to comment.