mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-07 07:13:54 +00:00
Update state on retrieval success
This commit is contained in:
parent
b566e91eaa
commit
fc3da6f19f
@ -24,13 +24,12 @@ const useAppList = (): UseAppListReturnType => {
|
||||
useEffect(() => {
|
||||
const loadAppsList = async () => {
|
||||
setIsLoading(true)
|
||||
let result
|
||||
try {
|
||||
result = await fetchSafeAppsList()
|
||||
const result = await fetchSafeAppsList()
|
||||
setApiAppsList(result && result?.apps.length ? result.apps : apiAppsList)
|
||||
} catch (err) {
|
||||
dispatch(enqueueSnackbar(NOTIFICATIONS.SAFE_APPS_FETCH_ERROR_MSG))
|
||||
}
|
||||
setApiAppsList(result && result?.length ? result : apiAppsList)
|
||||
setIsLoading(false)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user