Skip to content

Commit

Permalink
fix edge
Browse files Browse the repository at this point in the history
  • Loading branch information
maximun85 committed Sep 6, 2024
1 parent 5a4470c commit c7abebf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
6 changes: 4 additions & 2 deletions src/modules/blockchains/Buy/hooks/useCheckNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import { cloneDeep } from '../utils';
import { IModelOption } from '@/types/customize-model';
import { mouseDroppedPositionSignal } from '@/modules/blockchains/Buy/signals/useMouseDroppedPosition';
import useFormChain from './useFormChain';
import { useAAModule } from '@/modules/blockchains/detail_v4/hook/useAAModule';

export default function useCheckNodes() {
const { field } = useOrderFormStoreV3();
const { nodes, setNodes, edges, setEdges } = useFlowStore();
const { getCurrentFieldFromChain } = useFormChain();
const { lineBridgeStatus } = useBridgesModule();
const { lineAAStatus } = useAAModule();
const { dapps } = useDappsStore();
const store = useStoreApi();
const {
Expand Down Expand Up @@ -123,11 +125,11 @@ export default function useCheckNodes() {
target: `account_abstraction`,
targetHandle: `account_abstraction-t-${rootNode}`,
type: 'customEdge',
label: handleStatusEdges('', lineBridgeStatus, 'account_abstraction')
label: handleStatusEdges('', lineAAStatus, 'account_abstraction')
.icon,
animated: handleStatusEdges(
'',
lineBridgeStatus,
lineAAStatus,
'account_abstraction',
).animate,
markerEnd: {
Expand Down
29 changes: 15 additions & 14 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,39 +262,40 @@ export function isLocalhost() {

function handleStatusEdgeByBox(status: any) {
switch (status) {
case "draft":
case "setting_up":
case 'draft':
case 'setting_up':
case EAirdropStatus.new:
case '':
//draft
return {
animate: true,
icon: '',
}
// down
case "down":
case "run_out":
};
// down
case 'down':
case 'run_out':
case EAirdropStatus.ended:
case "stopped":
case 'stopped':
return {
animate: true,
icon: 'true',
}
//run
};
//run
default:
return {
animate: false,
icon: '',
}
};
}
}

export default function handleStatusEdges(statusDapp: any, status: aa, idNode: string) {
if(idNode === 'account-abstraction' || idNode === 'bridge_apps') {
return handleStatusEdgeByBox(status)
if (idNode === 'account_abstraction' || idNode === 'bridge_apps') {
console.log('status here', status);
return handleStatusEdgeByBox(status);
}

return handleStatusEdgeByBox(statusDapp)
return handleStatusEdgeByBox(statusDapp);
}

type aa = "draft" | "running" | "down" | 'setting_up' | EAirdropStatus
type aa = 'draft' | 'running' | 'down' | 'setting_up' | EAirdropStatus

0 comments on commit c7abebf

Please sign in to comment.