Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Bentlybro committed Nov 14, 2024
1 parent 61c6b2d commit 89435a5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions autogpt_platform/frontend/src/components/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const startTutorial = (
function handleMouseUp(event: { target: any }) {
const target = event.target;
const validConnectionPoint = document.querySelector(
'[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target"]'
'[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target"]',
);

if (validConnectionPoint && !validConnectionPoint.contains(target)) {
Expand Down Expand Up @@ -444,23 +444,24 @@ export const startTutorial = (
],
beforeShowPromise: () => {
return waitForElement(
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]');
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]',
);
},
when: {
show: () => {
fitViewToScreen();
resetConnectionState(); // Reset state when revisiting this step
tour.modal.show();
const outputPin = document.querySelector(
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]'
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]',
);
if (outputPin) {
outputPin.addEventListener("mousedown", handleMouseDown);
}
},
hide: () => {
const outputPin = document.querySelector(
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]'
'[data-testid^="rf__node-"]:first-child [data-id$="-result-source"]',
);
if (outputPin) {
outputPin.removeEventListener("mousedown", handleMouseDown);
Expand All @@ -479,7 +480,9 @@ export const startTutorial = (
},
buttons: [],
beforeShowPromise: () => {
return waitForElement('[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target"]').then(() => {
return waitForElement(
'[data-testid^="rf__node-"]:nth-child(2) [data-id$="-a-target"]',
).then(() => {
detectConnection();
});
},
Expand Down

0 comments on commit 89435a5

Please sign in to comment.