thiagoelg commented on code in PR #3119:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3119#discussion_r2078312185


##########
packages/online-editor/src/editor/Toolbar/Accelerators/AcceleratorsDropdown.tsx:
##########
@@ -58,13 +64,27 @@ export function AcceleratorsDropdown(props: Props) {
     [setAcceleratorsDropdownOpen]
   );
 
-  const onApplyAccelerator = useCallback(() => {
-    if (selectedAccelerator) {
-      applyAcceleratorToWorkspace(selectedAccelerator, props.workspaceFile);
-    }
-    setSelectedAccelerator(undefined);
-    setApplyModalOpen(false);
-  }, [applyAcceleratorToWorkspace, props.workspaceFile, selectedAccelerator]);
+  const onApplyAccelerator = useCallback(
+    async (authSessionId?: string) => {
+      if (!selectedAccelerator) {
+        console.error("Missing required parameters to apply accelerator");
+        return;
+      }
+      const authSessionObj = authSessions.get(authSessionId || "") as 
GitAuthSession;
+      try {
+        await applyAcceleratorToWorkspace(selectedAccelerator, 
props.workspaceFile, {
+          username: authSessionObj?.login,
+          password: authSessionObj?.token,
+        });

Review Comment:
   Since `authSessionId` is optional, when it's not provided we can skip 
passing the `authInfo` argument here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to