mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
04d6c3432f
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
18 lines
1.1 KiB
TypeScript
18 lines
1.1 KiB
TypeScript
/* eslint-disable */
|
|
export const APP_ID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID;
|
|
|
|
// prettier-ignore
|
|
export const load = (): void => {
|
|
(function(){const w=window;const ic=(w as any).Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',(w as any).intercomSettings);}else{const d=document;const i=function(){i.c(arguments);};i.q=[] as any[];i.c=function(args: any){i.q.push(args);};(w as any).Intercom=i;const l=function(){const s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + APP_ID;const x=d.getElementsByTagName('script')[0];x.parentNode?.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if((w as any).attachEvent){(window as any).attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
|
}
|
|
|
|
// Initializes Intercom
|
|
export const boot = (email: string): void => {
|
|
(window as any).Intercom &&
|
|
(window as any).Intercom("boot", { app_id: APP_ID, email });
|
|
};
|
|
|
|
export const update = (): void => {
|
|
window && (window as any).Intercom && (window as any).Intercom("update");
|
|
};
|