From 1677f7ae39f41a2109909b97849f620f58fa7f95 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 14 Feb 2024 13:59:36 +0000 Subject: [PATCH] DEV: Pass `post` instead of `transformedPost` to post-bottom-ad (#199) Changes in 0948d6b19e34320f95226cc43fbce976b71ceb31 caused the post-bottom-ad component to start receiving the widget-ised 'transformedPost' instead of the original `post` model. In most cases this difference didn't matter, but it did cause noticable issues with `@model.category` and `@model.topic`. This commit also deletes the unused `post-bottom/discourse-adplugin.hbs` connector. In the past, the adplugin itself was defining the post-bottom outlet. But now, we use RenderGlimmer to load the `post-bottom-ad` directly. --- .../discourse/connectors/post-bottom/discourse-adplugin.hbs | 1 - .../javascripts/discourse/initializers/initialize-ad-plugin.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 assets/javascripts/discourse/connectors/post-bottom/discourse-adplugin.hbs diff --git a/assets/javascripts/discourse/connectors/post-bottom/discourse-adplugin.hbs b/assets/javascripts/discourse/connectors/post-bottom/discourse-adplugin.hbs deleted file mode 100644 index 2c8ebe9..0000000 --- a/assets/javascripts/discourse/connectors/post-bottom/discourse-adplugin.hbs +++ /dev/null @@ -1 +0,0 @@ -{{post-bottom-ad model=this}} \ No newline at end of file diff --git a/assets/javascripts/discourse/initializers/initialize-ad-plugin.js b/assets/javascripts/discourse/initializers/initialize-ad-plugin.js index e9d18c9..babd4c6 100644 --- a/assets/javascripts/discourse/initializers/initialize-ad-plugin.js +++ b/assets/javascripts/discourse/initializers/initialize-ad-plugin.js @@ -14,7 +14,7 @@ export default { withPluginApi("0.1", (api) => { api.decorateWidget("post:after", (helper) => { - return helper.attach("after-post-ad", helper.attrs); + return helper.attach("after-post-ad", helper.widget.model); }); });