diff --git a/packages/app/src/composables/useAddress.ts b/packages/app/src/composables/useAddress.ts index 60e92dc850..92859e5c0e 100644 --- a/packages/app/src/composables/useAddress.ts +++ b/packages/app/src/composables/useAddress.ts @@ -192,7 +192,9 @@ export default (context = useContext()) => { } } catch (error: unknown) { item.value = null; - isRequestFailed.value = true; + if (!(error instanceof FetchError) || ![403, 404].includes(error.response?.status ?? 0)) { + isRequestFailed.value = true; + } } finally { isRequestPending.value = false; } diff --git a/packages/app/src/composables/useBlock.ts b/packages/app/src/composables/useBlock.ts index fe69c6baaa..ebae731943 100644 --- a/packages/app/src/composables/useBlock.ts +++ b/packages/app/src/composables/useBlock.ts @@ -42,7 +42,7 @@ export default (context = useContext()) => { blockItem.value = await FetchInstance.api(context)(`/blocks/${id}`); } catch (error: unknown) { blockItem.value = null; - if (!(error instanceof FetchError) || error.response?.status !== 404) { + if (!(error instanceof FetchError) || ![403, 404].includes(error.response?.status ?? 0)) { isRequestFailed.value = true; } } finally { diff --git a/packages/app/src/composables/useTransaction.ts b/packages/app/src/composables/useTransaction.ts index aac83464ba..bca1fceb37 100644 --- a/packages/app/src/composables/useTransaction.ts +++ b/packages/app/src/composables/useTransaction.ts @@ -182,7 +182,7 @@ export default (context = useContext()) => { return; } transaction.value = null; - if (!(error instanceof FetchError)) { + if (!(error instanceof FetchError) || error.response?.status !== 403) { isRequestFailed.value = true; } } finally { diff --git a/packages/app/src/locales/en.json b/packages/app/src/locales/en.json index 483dd058a1..0e600b777e 100644 --- a/packages/app/src/locales/en.json +++ b/packages/app/src/locales/en.json @@ -805,6 +805,8 @@ "notFound": { "title": "Oops, we can’t find anything", "description": "Sorry we can’t find anything on your search result, please try one more time via search bar below", + "prividiumTitle": "Nothing to show", + "prividiumDescription": "This page may not exist, or you might not have permissions to see it.", "contactSupportTitle": "If you think this is a problem with us, please", "contactSupport": "contact support" }, diff --git a/packages/app/src/views/BlockView.vue b/packages/app/src/views/BlockView.vue index ce8fe4d117..03f226b2c8 100644 --- a/packages/app/src/views/BlockView.vue +++ b/packages/app/src/views/BlockView.vue @@ -53,7 +53,7 @@ import { isBlockNumber } from "@/utils/validators"; const { t } = useI18n(); -const { setNotFoundView } = useNotFound(); +const { useNotFoundView, setNotFoundView } = useNotFound(); const { getById, blockItem, isRequestPending: blockPending, isRequestFailed: blockFailed } = useBlock(); const props = defineProps({ @@ -63,6 +63,8 @@ const props = defineProps({ }, }); +useNotFoundView(blockPending, blockFailed, blockItem); + const breadcrumbItems = computed((): BreadcrumbItem[] => [ { text: t("breadcrumbs.home"), diff --git a/packages/app/src/views/NotFound.vue b/packages/app/src/views/NotFound.vue index 3a922c8635..ccac53effc 100644 --- a/packages/app/src/views/NotFound.vue +++ b/packages/app/src/views/NotFound.vue @@ -1,9 +1,9 @@