-
Notifications
You must be signed in to change notification settings - Fork 674
Fix views crashing when description or content fields are null #997
Fix views crashing when description or content fields are null #997
Conversation
src/views/Article/View.tsx
Outdated
@@ -13,8 +13,8 @@ import { TypedArticleQuery } from "./query"; | |||
|
|||
import "./scss/index.scss"; | |||
|
|||
const canDisplay = page => | |||
maybe(() => !!page && !!page.title && !!page.content); | |||
const canDisplay = page => maybe(() => !!page && !!page.title); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe? 👮
const canDisplay = page => maybe(() => !!page && !!page.title); | |
const canDisplay = page => !!page?.title; |
src/views/Product/View.tsx
Outdated
!!product.# && | ||
!!product.variants | ||
); | ||
maybe(() => !!product.name && !!product.# && !!product.variants); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works 👍
I want to merge this change because it fixes pages / product details crashing when content or description fields are null
Screenshots
Pull Request Checklist
Test Environment Config
API_URI=https://master.staging.saleor.cloud/graphql/