From 26b62397bb41d3df61e48541f6c8f6f86b5d460e Mon Sep 17 00:00:00 2001 From: Josh Miller Date: Wed, 28 Feb 2024 12:02:51 +0000 Subject: [PATCH] Add deleteServiceState function to useServices hook --- frontend/hooks/useServices.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/hooks/useServices.tsx b/frontend/hooks/useServices.tsx index fe5f894be..7cca0be48 100644 --- a/frontend/hooks/useServices.tsx +++ b/frontend/hooks/useServices.tsx @@ -50,6 +50,9 @@ export const useServices = () => { }), ); + const deleteServiceState = (serviceHash: ServiceHash) => + setServices((prev) => prev.filter((s) => s.hash !== serviceHash)); + return { getService, getServiceFromState, @@ -57,6 +60,7 @@ export const useServices = () => { getServiceStatus, updateServicesState, updateServiceState, + deleteServiceState, createService, deployService, stopService,