diff --git a/src/pages/create/SafeCreatePage.tsx b/src/pages/create/SafeCreatePage.tsx index ccc9d88fb..d627b4024 100644 --- a/src/pages/create/SafeCreatePage.tsx +++ b/src/pages/create/SafeCreatePage.tsx @@ -37,7 +37,7 @@ export function SafeCreatePage() { if (daoFound) { navigate(DAO_ROUTES.dao.relative(addressPrefix, safeAddress)); } else { - toast.loading(t('failedIndexSafe')); + toast.info(t('failedIndexSafe'), { duration: Infinity }); navigate(BASE_ROUTES.landing); } }, diff --git a/src/providers/App/hooks/useSafeAPI.ts b/src/providers/App/hooks/useSafeAPI.ts index 5a4c57f66..cb3ab347f 100644 --- a/src/providers/App/hooks/useSafeAPI.ts +++ b/src/providers/App/hooks/useSafeAPI.ts @@ -50,9 +50,18 @@ class EnhancedSafeApiKit extends SafeApiKit { call = endpoint(); this.requestMap.set(cacheKey, call); } - value = await call; - this.requestMap.set(cacheKey, null); - await this.setCache(cacheKey, value, cacheMinutes); + try { + value = await call; + this.requestMap.set(cacheKey, null); + await this.setCache(cacheKey, value, cacheMinutes); + } catch (error) { + /* + await call can throw an exception with the Promise being rejected + Without resetting the cache, the same promise will be used in retrials and always throw an exception + */ + this.requestMap.set(cacheKey, null); + throw error; + } } return value; }