Skip to content

Commit

Permalink
Fix Incorrect error message for invalid QR code (#7588)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkurPrabhu authored Aug 1, 2024
1 parent f4e2e39 commit d70b99a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -137,7 +137,7 @@ const AssetsList = () => {
if (!data) {
setIsLoading(false);
Notification.Error({
msg: "Invalid QR code scanned !!!",
msg: t("invalid_asset_id_msg"),
});
return;
}
Expand All @@ -151,17 +151,22 @@ 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) {
console.log(err);
Notification.Error({
msg: t("invalid_asset_id_msg"),
});
} finally {
setIsLoading(false);
}
};

Expand Down
4 changes: 3 additions & 1 deletion src/Locale/en/Notifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
"unsubscribe_failed": "Unsubscribe failed.",
"unsubscribe": "Unsubscribe",
"escape": "Escape",
"loading": "Loading..."
"loading": "Loading...",
"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."
}

0 comments on commit d70b99a

Please sign in to comment.