From c98e643645a62f44120d3544933e7dd631513d3f Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sun, 14 Jan 2024 16:56:03 +0000 Subject: [PATCH] Small fixes --- frontend/src/basic/OrderPage/index.tsx | 1 - frontend/src/contexts/FederationContext.tsx | 10 +--------- frontend/src/models/Coordinator.model.ts | 2 +- frontend/src/models/Federation.model.ts | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/frontend/src/basic/OrderPage/index.tsx b/frontend/src/basic/OrderPage/index.tsx index 64290f8e..5ac9bac8 100644 --- a/frontend/src/basic/OrderPage/index.tsx +++ b/frontend/src/basic/OrderPage/index.tsx @@ -65,7 +65,6 @@ const OrderPage = (): JSX.Element => { const slot = garage.getSlot(); const robot = slot?.getRobot(); if (robot != null && slot?.token != null) { - void federation.fetchRobot(garage, slot.token); coordinator .fetchOrder(currentOrderId, robot, slot.token) .then((order) => { diff --git a/frontend/src/contexts/FederationContext.tsx b/frontend/src/contexts/FederationContext.tsx index 1ddbccf7..09434541 100644 --- a/frontend/src/contexts/FederationContext.tsx +++ b/frontend/src/contexts/FederationContext.tsx @@ -40,14 +40,6 @@ const statusToDelay = [ 300000, // 'Taker lost dispute' ]; -export interface fetchRobotProps { - coordinator?: Coordinator; - newKeys?: { encPrivKey: string; pubKey: string }; - newToken?: string; - slot?: number; - isRefresh?: boolean; -} - export interface FederationContextProviderProps { children: ReactNode; } @@ -167,7 +159,7 @@ export const FederationContextProvider = ({ void federation.fetchRobot(garage, slot.token); // create new robot with existing token and keys (on network and coordinator change) } } - }, [open.profile, hostUrl]); + }, [open.profile]); return ( => { + fetchRobot = async (garage: Garage, token: string): Promise => { if (!this.enabled || !token) return null; const robot = garage?.getSlot(token)?.getRobot() ?? null; diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index ca4ec54e..f5effe87 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -114,7 +114,7 @@ export class Federation { // Fetchs fetchRobot = async (garage: Garage, token: string): Promise => { Object.values(this.coordinators).forEach((coor) => { - void coor.fecthRobot(garage, token); + void coor.fetchRobot(garage, token); }); };