diff --git a/dappnode/hooks/use-get-exit-requests.ts b/dappnode/hooks/use-get-exit-requests.ts index 6b8c8ba7..9745c4b5 100644 --- a/dappnode/hooks/use-get-exit-requests.ts +++ b/dappnode/hooks/use-get-exit-requests.ts @@ -34,8 +34,18 @@ const useGetExitRequests = () => { throw new Error(`HTTP error! Status: ${response.status}`); } - const data = await response.json(); - setExitRequests(data); + const data: ExitRequests = await response.json(); + + // Statuses to include if have not started/ended the exit process + const includedStatuses = ['active_ongoing', 'active_slashed']; + + const filteredData = Object.fromEntries( + Object.entries(data).filter(([, exitRequest]) => + includedStatuses.includes(exitRequest.status), + ), + ); + + setExitRequests(filteredData); } catch (e) { console.error( `Error GETting validators exit requests from indexer API: ${e}`,