From cfc074a73a2a07057e02aea42660034f3f0beccd Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Thu, 14 Dec 2023 17:40:59 +0200 Subject: [PATCH 1/6] update msg to be more friendly --- packages/playground/src/dashboard/components/user_farms.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/src/dashboard/components/user_farms.vue b/packages/playground/src/dashboard/components/user_farms.vue index de4b92e688..f1e24b3269 100644 --- a/packages/playground/src/dashboard/components/user_farms.vue +++ b/packages/playground/src/dashboard/components/user_farms.vue @@ -214,7 +214,7 @@ export default { farmsCount.value = count || filteredFarms.length; } catch (error) { console.log(error); - createCustomToast("Failed to get user farms!", ToastType.danger); + createCustomToast("Failed to get farms. Please check your connection.", ToastType.danger); } finally { loading.value = false; } From 29e54d86cac98953e826b725853fd8d06b55f83e Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Sun, 17 Dec 2023 13:17:13 +0200 Subject: [PATCH 2/6] use normalizeError --- packages/playground/src/dashboard/components/user_farms.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/playground/src/dashboard/components/user_farms.vue b/packages/playground/src/dashboard/components/user_farms.vue index f1e24b3269..3f1d751bd9 100644 --- a/packages/playground/src/dashboard/components/user_farms.vue +++ b/packages/playground/src/dashboard/components/user_farms.vue @@ -122,6 +122,7 @@ import { gridProxyClient } from "@/clients"; import CardDetails from "@/components/node_details_cards/card_details.vue"; import { useGrid, useProfileManager } from "@/stores"; import { createCustomToast, ToastType } from "@/utils/custom_toast"; +import { normalizeError } from "@/utils/helpers"; import { generateNodeSummary, generateReceipt, @@ -214,7 +215,10 @@ export default { farmsCount.value = count || filteredFarms.length; } catch (error) { console.log(error); - createCustomToast("Failed to get farms. Please check your connection.", ToastType.danger); + createCustomToast( + normalizeError(error as Error | string | undefined, "Failed to get farms. Please check your connection."), + ToastType.danger, + ); } finally { loading.value = false; } From 356f7b16a5ff36c0c733acc7bb09ca62f00e5664 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Sun, 17 Dec 2023 14:27:23 +0200 Subject: [PATCH 3/6] remove normalizeError --- packages/playground/src/dashboard/components/user_farms.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/playground/src/dashboard/components/user_farms.vue b/packages/playground/src/dashboard/components/user_farms.vue index 3f1d751bd9..f1e24b3269 100644 --- a/packages/playground/src/dashboard/components/user_farms.vue +++ b/packages/playground/src/dashboard/components/user_farms.vue @@ -122,7 +122,6 @@ import { gridProxyClient } from "@/clients"; import CardDetails from "@/components/node_details_cards/card_details.vue"; import { useGrid, useProfileManager } from "@/stores"; import { createCustomToast, ToastType } from "@/utils/custom_toast"; -import { normalizeError } from "@/utils/helpers"; import { generateNodeSummary, generateReceipt, @@ -215,10 +214,7 @@ export default { farmsCount.value = count || filteredFarms.length; } catch (error) { console.log(error); - createCustomToast( - normalizeError(error as Error | string | undefined, "Failed to get farms. Please check your connection."), - ToastType.danger, - ); + createCustomToast("Failed to get farms. Please check your connection.", ToastType.danger); } finally { loading.value = false; } From b3e2600e2cd7661d2ecd64d950251dc41daa29e4 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Tue, 19 Dec 2023 16:44:06 +0200 Subject: [PATCH 4/6] check if connection error or smth else --- .../playground/src/dashboard/components/user_farms.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/playground/src/dashboard/components/user_farms.vue b/packages/playground/src/dashboard/components/user_farms.vue index 559a47f2b2..f86e8fdf38 100644 --- a/packages/playground/src/dashboard/components/user_farms.vue +++ b/packages/playground/src/dashboard/components/user_farms.vue @@ -131,6 +131,7 @@