onToolbarCreate only show button on topic creation

(Aedensixty) #1

I am adding a button to the toolbar on the editor using

'onToolbarCreate(toolbar => {
          id: "button",
          group: "extras",
          icon: "picture-o",
          action: 'action'

however I need this to only show on the ‘create topic’ version of the editor and not the reply. Is there any options for doing this?

(Robin Ward) #2

There is no easy way to do this unfortunately. You could try and figure out in the closure whether the composer is in create or reply mode, but that would be quite brittle for upgrades, and it wouldn’t be bound in case a user switches the composer from creating a topic to replying.