Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 20, 2024
1 parent 0afcf0b commit 2e03979
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion posthog/models/remote_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _build_site_apps_js(self):
config = get_site_config_from_schema(site_app.config_schema, site_app.config)
site_apps_js.append(
indent_js(
f"\n{{\n id: '{site_app.token}',\n init: function(config) {{\n {indent_js(site_app.source, indent=4)}().inject({{ config:{json.dumps(config)}, posthog:config.posthog }});\n config.callback();\n return {{}} }}\n}}"
f"\n{{\n id: '{site_app.token}',\n init: function(config) {{\n {indent_js(site_app.source, indent=4)}().inject({{ config:{json.dumps(config)}, posthog:config.posthog }});\n config.callback(); return {{}} }}\n}}"
)
)
site_functions = (
Expand Down
6 changes: 3 additions & 3 deletions posthog/models/test/test_remote_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,21 +542,21 @@ def test_renders_js_including_site_apps(self):
init: function(config) {
(function () { return { inject: (data) => console.log('injected!', data)}; })().inject({ config:{}, posthog:config.posthog });
config.callback();
}
return {} }
},
{
id: 'tokentoken',
init: function(config) {
(function () { return { inject: (data) => console.log('injected 2!', data)}; })().inject({ config:{}, posthog:config.posthog });
config.callback();
}
return {} }
},
{
id: 'tokentoken',
init: function(config) {
(function () { return { inject: (data) => console.log('injected but disabled!', data)}; })().inject({ config:{}, posthog:config.posthog });
config.callback();
}
return {} }
}]
}
})();\
Expand Down

0 comments on commit 2e03979

Please sign in to comment.