Executing action on filebrowser change

I’m trying to create an extension that hides the filebrowser toolbar while in a specific directory. I’ve figured out how to hide the toolbar itself, but haven’t been able to make it happen when the active directory of the filebrowser changes. Any help would be greatly appreciated!

There is a method called pathChanged for example:

const browser = factory.createFileBrowser('custom-browser');

browser.model.pathChanged.connect(async (model: FileBrowserModel, change: IChangedArgs<string>) => {
   // execute actions 
  })

Basically what would do is subscribe to this Signal. Also you can use the model parameter and check where you are at for example using model.path

I hope this helps you somehow.