Fix: Make version changeable from the environment vars (#4654)
This commit is contained in:
parent
81d0405473
commit
9ed1f5d96b
5 changed files with 9 additions and 5 deletions
|
@ -38,9 +38,12 @@ class DashboardController < ActionController::Base
|
|||
end
|
||||
|
||||
def app_config
|
||||
{ APP_VERSION: Chatwoot.config[:version],
|
||||
{
|
||||
APP_VERSION: Chatwoot.config[:version],
|
||||
VAPID_PUBLIC_KEY: VapidService.public_key,
|
||||
ENABLE_ACCOUNT_SIGNUP: GlobalConfigService.load('ENABLE_ACCOUNT_SIGNUP', 'false'),
|
||||
FB_APP_ID: GlobalConfigService.load('FB_APP_ID', '') }
|
||||
FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''),
|
||||
FACEBOOK_API_VERSION: 'v13.0'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ export const createMessengerScript = pageId => `
|
|||
FB.init({
|
||||
appId: "${window.chatwootConfig.fbAppId}",
|
||||
xfbml: true,
|
||||
version: "v4.0"
|
||||
version: "${window.chatwootConfig.fbApiVersion}"
|
||||
});
|
||||
};
|
||||
(function(d, s, id){
|
||||
|
|
|
@ -163,7 +163,7 @@ export default {
|
|||
FB.init({
|
||||
appId: window.chatwootConfig.fbAppId,
|
||||
xfbml: true,
|
||||
version: 'v12.0',
|
||||
version: window.chatwootConfig.fbApiVersion,
|
||||
status: true,
|
||||
});
|
||||
window.fbSDKLoaded = true;
|
||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
|||
FB.init({
|
||||
appId: window.chatwootConfig.fbAppId,
|
||||
xfbml: true,
|
||||
version: 'v12.0',
|
||||
version: window.chatwootConfig.fbApiVersion,
|
||||
status: true,
|
||||
});
|
||||
window.fbSDKLoaded = true;
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
window.chatwootConfig = {
|
||||
hostURL: '<%= ENV.fetch('FRONTEND_URL', '') %>',
|
||||
fbAppId: '<%= ENV.fetch('FB_APP_ID', nil) %>',
|
||||
fbApiVersion: '<%= @global_config['FACEBOOK_API_VERSION'] %>',
|
||||
signupEnabled: '<%= @global_config['ENABLE_ACCOUNT_SIGNUP'] %>',
|
||||
<% if @global_config['VAPID_PUBLIC_KEY'] %>
|
||||
vapidPublicKey: new Uint8Array(<%= Base64.urlsafe_decode64(@global_config['VAPID_PUBLIC_KEY']).bytes %>),
|
||||
|
|
Loading…
Reference in a new issue