Revert "Refactor"

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