nuxt-intercom
Advanced tools
Comparing version
/// <reference types="@types/intercom-web" /> | ||
import { Plugin } from "@nuxt/types"; | ||
export declare function getIntercomInstance(command?: Intercom_.IntercomCommand, ...args: any): Promise<typeof Intercom | void>; | ||
export declare function getIntercomInstance(command?: Intercom_.IntercomCommand, args?: any): Promise<typeof Intercom | void>; | ||
declare const intercomPlugin: Plugin; | ||
export default intercomPlugin; |
@@ -22,2 +22,3 @@ function _isTrue(val) { | ||
const script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.async = true; | ||
@@ -48,6 +49,3 @@ script.src = `${INTERCOM_URL}${settings.app_id}`; | ||
resolve(window.Intercom); | ||
}); | ||
script.addEventListener("error", () => { | ||
reject(new Error("Failed to load Intercom")); | ||
}); | ||
}, false); | ||
} | ||
@@ -60,3 +58,3 @@ catch (error) { | ||
}; | ||
export async function getIntercomInstance(command, ...args) { | ||
export async function getIntercomInstance(command, args) { | ||
let instance = window.Intercom; | ||
@@ -63,0 +61,0 @@ if (!instance) { |
{ | ||
"name": "nuxt-intercom", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "NuxtJS module for Intercom", | ||
@@ -5,0 +5,0 @@ "repository": "github:dogchef-be/nuxt-intercom", |
Sorry, the diff of this file is not supported yet
10605
-1.59%98
-2%