Small fixes

This commit is contained in:
Reckless_Satoshi 2024-01-14 16:56:03 +00:00
parent 9d8c8d5e0d
commit c98e643645
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
4 changed files with 3 additions and 12 deletions

View File

@ -65,7 +65,6 @@ const OrderPage = (): JSX.Element => {
const slot = garage.getSlot(); const slot = garage.getSlot();
const robot = slot?.getRobot(); const robot = slot?.getRobot();
if (robot != null && slot?.token != null) { if (robot != null && slot?.token != null) {
void federation.fetchRobot(garage, slot.token);
coordinator coordinator
.fetchOrder(currentOrderId, robot, slot.token) .fetchOrder(currentOrderId, robot, slot.token)
.then((order) => { .then((order) => {

View File

@ -40,14 +40,6 @@ const statusToDelay = [
300000, // 'Taker lost dispute' 300000, // 'Taker lost dispute'
]; ];
export interface fetchRobotProps {
coordinator?: Coordinator;
newKeys?: { encPrivKey: string; pubKey: string };
newToken?: string;
slot?: number;
isRefresh?: boolean;
}
export interface FederationContextProviderProps { export interface FederationContextProviderProps {
children: ReactNode; 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) 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 ( return (
<FederationContext.Provider <FederationContext.Provider

View File

@ -293,7 +293,7 @@ export class Coordinator {
} }
}; };
fecthRobot = async (garage: Garage, token: string): Promise<Robot | null> => { fetchRobot = async (garage: Garage, token: string): Promise<Robot | null> => {
if (!this.enabled || !token) return null; if (!this.enabled || !token) return null;
const robot = garage?.getSlot(token)?.getRobot() ?? null; const robot = garage?.getSlot(token)?.getRobot() ?? null;

View File

@ -114,7 +114,7 @@ export class Federation {
// Fetchs // Fetchs
fetchRobot = async (garage: Garage, token: string): Promise<void> => { fetchRobot = async (garage: Garage, token: string): Promise<void> => {
Object.values(this.coordinators).forEach((coor) => { Object.values(this.coordinators).forEach((coor) => {
void coor.fecthRobot(garage, token); void coor.fetchRobot(garage, token);
}); });
}; };