From 7ba0f7d5c2f18c1834f5635b2586d85840c49bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Luiz=20de=20Castro?= Date: Mon, 21 Feb 2022 21:27:04 -0300 Subject: [PATCH 1/2] Fix: Fixed a bug where removing all items from review block would send the user to a nothing to show page --- CHANGELOG.md | 4 ++++ react/TextAreaBlock.tsx | 7 +++---- react/UploadBlock.tsx | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4f09745..3eaab7dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Fixed a bug where removing all items from review block would send the user to a "nothing to show" page. + ## [3.7.0] - 2022-02-10 ### Fixed diff --git a/react/TextAreaBlock.tsx b/react/TextAreaBlock.tsx index fcadd4d7..0f073d3d 100644 --- a/react/TextAreaBlock.tsx +++ b/react/TextAreaBlock.tsx @@ -17,7 +17,7 @@ import { usePWA } from 'vtex.store-resources/PWAContext' import { usePixel } from 'vtex.pixel-manager/PixelContext' import ReviewBlock from './components/ReviewBlock' -import { ParseText, GetText } from './utils' +import { ParseText } from './utils' const messages = defineMessages({ success: { @@ -182,7 +182,7 @@ const TextAreaBlock: FunctionComponent { - if (items) { + if (items?.length) { const show = items.filter((item: any) => { return !item.vtexSku @@ -193,9 +193,8 @@ const TextAreaBlock: FunctionComponent { - if (items) { + if (items?.length) { const show = items.filter((item: any) => { return !item.vtexSku @@ -146,7 +146,7 @@ const UploadBlock: FunctionComponent Date: Mon, 21 Feb 2022 21:34:32 -0300 Subject: [PATCH 2/2] Fix: Adjusting the changelog file --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eaab7dd..fff331b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed -- Fixed a bug where removing all items from review block would send the user to a "nothing to show" page. +- Fixed a bug where removing all items from review block would send the user to a "Nothing to Show" page. ## [3.7.0] - 2022-02-10