1+ import { action } from "@ember/object" ;
12import { ajax } from "discourse/lib/ajax" ;
23import { popupAjaxError } from "discourse/lib/ajax-error" ;
34import { withPluginApi } from "discourse/lib/plugin-api" ;
@@ -23,21 +24,23 @@ export default {
2324 } ;
2425
2526 withPluginApi ( "0.8.36" , ( api ) => {
26- api . modifyClass ( "component:d-navigation" , {
27- pluginId : "custom-wizard" ,
28- actions : {
29- clickCreateTopicButton ( ) {
30- let createTopicWizard = this . get (
31- "category.custom_fields.create_topic_wizard"
32- ) ;
33- if ( createTopicWizard ) {
34- window . location . href = getUrl ( `/w/${ createTopicWizard } ` ) ;
35- } else {
36- this . _super ( ) ;
37- }
38- } ,
39- } ,
40- } ) ;
27+ api . modifyClass (
28+ "component:d-navigation" ,
29+ ( Superclass ) =>
30+ class extends Superclass {
31+ @action
32+ clickCreateTopicButton ( ) {
33+ let createTopicWizard = this . get (
34+ "category.custom_fields.create_topic_wizard"
35+ ) ;
36+ if ( createTopicWizard ) {
37+ window . location . href = getUrl ( `/w/${ createTopicWizard } ` ) ;
38+ } else {
39+ super . clickCreateTopicButton ( ) ;
40+ }
41+ }
42+ }
43+ ) ;
4144
4245 api . modifyClass ( "component:d-editor" , {
4346 pluginId : "custom-wizard" ,
0 commit comments