This commit is contained in:
ivanahuckova
2025-10-13 13:38:39 +02:00
parent 8083bec978
commit ffd901ed0c
@@ -47,12 +47,8 @@ export function ExtensionToolbarItem({ compact }: Props) {
isOpen={isActive}
title={component.title}
onClick={() => {
const appEvents = getAppEvents();
if (isActive) {
appEvents.publish(new CloseExtensionSidebarEvent());
} else {
appEvents.publish(new OpenExtensionSidebarEvent({ pluginId, componentTitle: component.title }));
}
const event = isActive ? new CloseExtensionSidebarEvent() : new OpenExtensionSidebarEvent({ pluginId, componentTitle: component.title });
getAppEvents().publish(event);
}}
pluginId={pluginId}
/>
@@ -70,12 +66,8 @@ export function ExtensionToolbarItem({ compact }: Props) {
active={dockedComponentId === id}
label={c.title}
onClick={() => {
const appEvents = getAppEvents();
if (dockedComponentId === id) {
appEvents.publish(new CloseExtensionSidebarEvent());
} else {
appEvents.publish(new OpenExtensionSidebarEvent({ pluginId, componentTitle: c.title }));
}
const event = dockedComponentId === id ? new CloseExtensionSidebarEvent() : new OpenExtensionSidebarEvent({ pluginId, componentTitle: c.title });
getAppEvents().publish(event);
}}
/>
);