Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed Sep 25, 2023
1 parent 5d51d37 commit 8472158
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/decide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Decide {
// Check if recorder.js is already loaded
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const surveysGenerator = window?.generateSurveys
const surveysGenerator = window?.extendPostHogWithSurveys

if (response['surveys'] && !surveysGenerator) {
loadScript(this.instance.get_config('api_host') + `/static/surveys.js`, (err) => {
Expand All @@ -87,7 +87,7 @@ export class Decide {

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.generateSurveys(this.instance)
window.extendPostHogWithSurveys(this.instance)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/loader-surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { generateSurveys } from './extensions/surveys'

const win: Window & typeof globalThis = typeof window !== 'undefined' ? window : ({} as typeof window)

;(win as any).generateSurveys = generateSurveys
;(win as any).extendPostHogWithSurveys = generateSurveys

export default generateSurveys

0 comments on commit 8472158

Please sign in to comment.