From 35cc8c247de8e44b50c51cb98b9183656d793db1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 11 Sep 2024 14:35:05 +0700 Subject: [PATCH] fix(status): fix import status message (#4325) Co-authored-by: Dmitry Mukovkin --- .../components/collections/ImportExport.vue | 18 ++++++++++-------- .../collections/graphql/ImportExport.vue | 2 +- .../components/environments/ImportExport.vue | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/hoppscotch-common/src/components/collections/ImportExport.vue b/packages/hoppscotch-common/src/components/collections/ImportExport.vue index 726ea4eb5..dc098b53f 100644 --- a/packages/hoppscotch-common/src/components/collections/ImportExport.vue +++ b/packages/hoppscotch-common/src/components/collections/ImportExport.vue @@ -401,15 +401,17 @@ const HoppMyCollectionsExporter: ImporterOrExporter = { "hoppscotch-personal-collections" ) - E.isRight(message) - ? toast.success(t(message.right)) - : toast.error(t(message.left)) + if (E.isRight(message)) { + toast.success(t("state.download_started")) - platform.analytics?.logEvent({ - type: "HOPP_EXPORT_COLLECTION", - exporter: "json", - platform: "rest", - }) + platform.analytics?.logEvent({ + type: "HOPP_EXPORT_COLLECTION", + exporter: "json", + platform: "rest", + }) + } else { + toast.error(t(message.left)) + } isHoppMyCollectionExporterInProgress.value = false }, diff --git a/packages/hoppscotch-common/src/components/collections/graphql/ImportExport.vue b/packages/hoppscotch-common/src/components/collections/graphql/ImportExport.vue index 18062ca95..a9716c992 100644 --- a/packages/hoppscotch-common/src/components/collections/graphql/ImportExport.vue +++ b/packages/hoppscotch-common/src/components/collections/graphql/ImportExport.vue @@ -148,7 +148,7 @@ const GqlCollectionsHoppExporter: ImporterOrExporter = { return } - toast.success(message.right) + toast.success(t("state.download_started")) platform.analytics?.logEvent({ type: "HOPP_EXPORT_COLLECTION", diff --git a/packages/hoppscotch-common/src/components/environments/ImportExport.vue b/packages/hoppscotch-common/src/components/environments/ImportExport.vue index 2f86598d7..6d7c0a6d5 100644 --- a/packages/hoppscotch-common/src/components/environments/ImportExport.vue +++ b/packages/hoppscotch-common/src/components/environments/ImportExport.vue @@ -239,11 +239,11 @@ const HoppEnvironmentsExport: ImporterOrExporter = { ) if (E.isLeft(message)) { - toast.error(t(message.left)) + toast.error(t("export.failed")) return } - toast.success(t(message.right)) + toast.success(t("state.download_started")) platform.analytics?.logEvent({ type: "HOPP_EXPORT_ENVIRONMENT",