Add id to decorateCooked API call

Add id to decorateCooked API call

  • fixes deprecation warning, decorateCooked calls now need an id
diff --git a/assets/javascripts/initializers/discourse-graphviz.js.es6 b/assets/javascripts/initializers/discourse-graphviz.js.es6
index aba12a2..c24d616 100644
--- a/assets/javascripts/initializers/discourse-graphviz.js.es6
+++ b/assets/javascripts/initializers/discourse-graphviz.js.es6
@@ -36,24 +36,27 @@ export default {
 
   initialize() {
     withPluginApi("0.8.22", api => {
-      api.decorateCooked($elem => {
-        const $graphviz = $elem.find(".graphviz");
-
-        if (
-          $graphviz.length &&
-          Discourse.SiteSettings.discourse_graphviz_enabled
-        ) {
-          $graphviz.each((_, nodeContainer) => {
-            const $container = $(nodeContainer);
-
-            // if the container content has not yet been replaced
-            // do nothing
-            if (!$container.find("svg").length) {
-              run.debounce(this, this.renderGraph, $container, 200);
-            }
-          });
-        }
-      });
+      api.decorateCooked(
+        $elem => {
+          const $graphviz = $elem.find(".graphviz");
+
+          if (
+            $graphviz.length &&
+            Discourse.SiteSettings.discourse_graphviz_enabled
+          ) {
+            $graphviz.each((_, nodeContainer) => {
+              const $container = $(nodeContainer);
+
+              // if the container content has not yet been replaced
+              // do nothing
+              if (!$container.find("svg").length) {
+                run.debounce(this, this.renderGraph, $container, 200);
+              }
+            });
+          }
+        },
+        { id: "graphviz" }
+      );
     });
   }
 };

GitHub sha: 83209c4b