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