From 25ab42a25c3cbdb735ae98ff62fcf0e976b04f74 Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Wed, 31 Jul 2024 19:48:02 +0530 Subject: [PATCH] use more user friendly error messages --- src/Components/Assets/AssetsList.tsx | 8 ++++---- src/Locale/en/Notifications.json | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index ee422205d16..fa609e0e3b8 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -121,7 +121,7 @@ const AssetsList = () => { if (!isValidURL(assetURL)) { setIsLoading(false); Notification.Error({ - msg: "Invalid QR code scanned !!!", + msg: t("invalid_asset_id_msg"), }); return; } @@ -137,7 +137,7 @@ const AssetsList = () => { if (!data) { setIsLoading(false); Notification.Error({ - msg: "Invalid QR code scanned !!!", + msg: t("invalid_asset_id_msg"), }); return; } @@ -151,13 +151,13 @@ const AssetsList = () => { } else { setIsLoading(false); Notification.Error({ - msg: "Asset not found !!!", + msg: t("asset_not_found_msg"), }); } } else { setIsLoading(false); Notification.Error({ - msg: "Invalid QR code scanned !!!", + msg: t("invalid_asset_id_msg"), }); } } catch (err) { diff --git a/src/Locale/en/Notifications.json b/src/Locale/en/Notifications.json index 0a49c5844a6..dac9c29730f 100644 --- a/src/Locale/en/Notifications.json +++ b/src/Locale/en/Notifications.json @@ -17,5 +17,6 @@ "unsubscribe": "Unsubscribe", "escape": "Escape", "loading": "Loading...", - "invalid_asset_id_msg": "Oops! The asset ID you entered does not appear to be valid." + "invalid_asset_id_msg": "Oops! The asset ID you entered does not appear to be valid.", + "asset_not_found_msg": "Oops! The asset you are looking for does not exist. Please check the asset id." }