Skip to content

Commit

Permalink
Merge pull request #668 from vtex-apps/fix/storefront-error-page
Browse files Browse the repository at this point in the history
Fix/storefront error page
  • Loading branch information
anitavincent authored Sep 30, 2024
2 parents e800b53 + a8864d5 commit 7975f9e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Admin error page showing up on client side errors on storefront.
- Refresh page counter taking too long.

## [8.134.9] - 2024-09-25

### Added
Expand Down Expand Up @@ -1718,4 +1723,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[8.134.6-beta]: https://github.com/vtex-apps/render-runtime/compare/v8.134.5...v8.134.6-beta
[8.134.7-beta]: https://github.com/vtex-apps/render-runtime/compare/v8.134.6...v8.134.7-beta
[8.134.8-beta]: https://github.com/vtex-apps/render-runtime/compare/v8.134.7...v8.134.8-beta
[8.134.9-beta]: https://github.com/vtex-apps/render-runtime/compare/v8.134.8...v8.134.9-beta
[8.134.9-beta]: https://github.com/vtex-apps/render-runtime/compare/v8.134.8...v8.134.9-beta
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "render-runtime",
"version": "8.134.9",
"version": "8.134.11-beta.0",
"title": "VTEX Render runtime",
"description": "The VTEX Render framework runtime",
"builders": {
Expand Down
7 changes: 6 additions & 1 deletion react/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ class ErrorBoundary extends React.Component<Props> {
if (!production) {
return <ErrorDisplay error={error} errorInfo={errorInfo} />
}
return <ErrorPage />

if (isAdmin()) {
return <ErrorPage />
}

return null
}

return this.props.children
Expand Down
2 changes: 1 addition & 1 deletion react/components/ErrorPage/RefreshCounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function RefreshCounter() {
useEffect(() => {
if (counter > 0) {
const timer = setInterval(
(prevCounter: number) => setCounter(prevCounter - 1),
() => setCounter((prevCounter) => prevCounter - 1),
1000
)
return () => clearInterval(timer)
Expand Down

0 comments on commit 7975f9e

Please sign in to comment.