Skip to content

Commit

Permalink
chore: removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-arc10 committed Nov 26, 2024
1 parent eeb82b8 commit 6bf0dfc
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ export function ControlMachineProvider({ children }: Props) {
const [controlMachineDrawerOpen, setControlMachineDrawerOpen] = useState(false);

useEffect(() => {
console.log("isWalletArbitrarySigned", isWalletArbitrarySigned);
if (isWalletArbitrarySigned || isProvider) {
console.log("controlMachines", controlMachines);
const controlMachine = controlMachines.find(machine => machine.address === address);

if (!controlMachine) {
return;
}

// first check control machine connection
(async () => {
try {
setControlMachineLoading(true);
Expand Down Expand Up @@ -69,12 +66,10 @@ export function ControlMachineProvider({ children }: Props) {
setControlMachines(prev => {
const existingIndex = prev.findIndex(machine => machine.address === controlMachine.address);
if (existingIndex !== -1) {
// Update existing control machine
const updated = [...prev];
updated[existingIndex] = controlMachine;
return updated;
}
// Add new control machine if none exists with this address
return [...prev, controlMachine];
});
setControlMachineDrawerOpen(false);
Expand Down

0 comments on commit 6bf0dfc

Please sign in to comment.