adding loading state for gateways

This commit is contained in:
Gala
2022-10-20 15:19:27 +02:00
parent d6ffdb86ce
commit 76144928a0
+1
View File
@@ -109,6 +109,7 @@ export const MainContextProvider: React.FC = ({ children }) => {
};
const fetchGateways = async () => {
setGateways((d) => ({ ...d, isLoading: true }));
try {
const data = await Api.fetchGateways();
setGateways({ data, isLoading: false });