Skip to content

Commit

Permalink
fix: #681 bug live chat after migrate to config.json (#696)
Browse files Browse the repository at this point in the history
Changes
- Change chatbot App ID from process.env to window.reapit.config
  • Loading branch information
Pham Hai Duong authored Mar 23, 2020
1 parent 6d99a1a commit 576b2e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = {
'packages/*/build',
'packages/*/dist',
'packages/*/public/dist',
'chat-bot.js'
],
rules: {
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/src/core/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ window.reapit = {
googleAnalyticsKey: '',
cognitoOAuthUrl: '',
cognitoUserPoolId: '',
chatbotAppId: '',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/scripts/chat-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(loginIdentity) {
(n.src = 'https://w.chatlio.com/w.chatlio-widget.js'),
(n.async = !0),
n.setAttribute('data-embed-version', '2.3')
n.setAttribute('data-widget-id', process.env.CHATBOT_APP_ID)
n.setAttribute('data-widget-id', window.reapit.config.chatbotAppId)
c.parentNode.insertBefore(n, c)

if (loginIdentity) {
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type Config = {
googleAnalyticsKey: string
cognitoOAuthUrl: string
cognitoUserPoolId: string
chatbotAppId: string
}

declare global {
Expand Down

0 comments on commit 576b2e7

Please sign in to comment.