From 739559f8dd75b15d924a9b10b8368d596560c610 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Tue, 19 Dec 2023 15:08:52 +0200 Subject: [PATCH] fix: don't do prefetch request for tx search --- packages/app/src/composables/useSearch.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app/src/composables/useSearch.ts b/packages/app/src/composables/useSearch.ts index 97fd55c685..1f8e0daac7 100644 --- a/packages/app/src/composables/useSearch.ts +++ b/packages/app/src/composables/useSearch.ts @@ -20,18 +20,21 @@ export default (context = useContext()) => { apiRoute: "address", isValid: () => isAddress(param), routeName: "address", + prefetch: true, }, { routeParam: { id: param }, apiRoute: "batches", isValid: () => isBlockNumber(param), routeName: "batch", + prefetch: true, }, { routeParam: { hash: param }, apiRoute: "transactions", isValid: () => isTransactionHash(param), routeName: "transaction", + prefetch: false, }, ]; @@ -46,7 +49,9 @@ export default (context = useContext()) => { const searchRoute = getSearchRoute(param); if (searchRoute) { try { - await $fetch(`${context.currentNetwork.value.apiUrl}/${searchRoute.apiRoute}/${param}`); + if (searchRoute.prefetch) { + await $fetch(`${context.currentNetwork.value.apiUrl}/${searchRoute.apiRoute}/${param}`); + } await router.push({ name: searchRoute.routeName, params: searchRoute.routeParam }); return; } catch (error) {