From 353fe88cad3323b7ab36f825972a1170d7f7beb8 Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Fri, 18 Oct 2024 06:05:18 +0100 Subject: [PATCH] fix(frontend): config context typing --- frontend/src/contexts/config.context.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/contexts/config.context.tsx b/frontend/src/contexts/config.context.tsx index d84f28e5..c18f0198 100644 --- a/frontend/src/contexts/config.context.tsx +++ b/frontend/src/contexts/config.context.tsx @@ -6,7 +6,7 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ -import { useState, useEffect, createContext } from "react"; +import { createContext, useEffect, useState } from "react"; export const ConfigContext = createContext(null); @@ -16,13 +16,13 @@ export interface IConfig { } export const ConfigProvider = ({ children }) => { - const [config, setConfig] = useState(null); + const [config, setConfig] = useState(null); useEffect(() => { const fetchConfig = async () => { try { const res = await fetch("/config"); - const data = await res.json(); + const data = (await res.json()) as IConfig; setConfig(data); } catch (error) {