Add sidebar tab on app start not working

I was able to resolve this by adding new event based on the 'workspace:change event.

I added this js file to the editorTheme.page.scripts array.

// editor-loaded-event.js
RED.events.on('workspace:change', () => {
    RED.events.off('workspace:change', () => {});
    RED.events.emit('editor:loaded');
});

The editor:loaded event will trigger only once after the app is ready.

Usage:

RED.events.on('editor:loaded', () => {
    RED.notify('hello world');
});

RED.events.on('editor:loaded', () => {
     RED.sidebar.addTab(...);
});
1 Like