File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
components/CheckoutActions Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ const MessageDiv = styled.div`
3636
3737const NoPaymentMethodsMessage = ( ) => < MessageDiv > No payment methods available</ MessageDiv > ;
3838
39+ NoPaymentMethodsMessage . renderComplete = ( ) => "" ;
40+
3941@withAddressValidation
4042@track ( )
4143@observer
Original file line number Diff line number Diff line change 11#import "./tagFragment.gql"
22
3- query tagQuery ($slugOrId : String ) {
4- tag (slugOrId : $slugOrId ) {
3+ query tagQuery ($shopId : ID ! , $ slugOrId : String ! ) {
4+ tag (shopId : $shopId , slugOrId : $slugOrId ) {
55 ... TagInfo
66 }
77}
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ import tagQuery from "./tag.gql";
1212 * @returns {React.Component } - Component with `tag` prop
1313 */
1414export default function withTag ( Component ) {
15- @inject ( "routingStore" )
15+ @inject ( "primaryShopId" , " routingStore")
1616 @observer
1717 class WithTag extends React . Component {
1818 static propTypes = {
19+ primaryShopId : PropTypes . string . isRequired ,
1920 /**
2021 * slug used to obtain tag info
2122 */
@@ -27,14 +28,19 @@ export default function withTag(Component) {
2728
2829 render ( ) {
2930 const {
31+ primaryShopId,
3032 router : { query : { slug : slugFromQueryParam } } ,
3133 routingStore : { tagId }
3234 } = this . props ;
3335
3436 const slugOrId = slugFromQueryParam || tagId ;
3537
38+ if ( ! primaryShopId || ! slugOrId ) {
39+ return < Component { ...this . props } /> ;
40+ }
41+
3642 return (
37- < Query query = { tagQuery } variables = { { slugOrId } } >
43+ < Query query = { tagQuery } variables = { { shopId : primaryShopId , slugOrId } } >
3844 { ( { error, data } ) => {
3945 if ( error ) {
4046 console . error ( "WithTag query error:" , error ) ; // eslint-disable-line no-console
You can’t perform that action at this time.
0 commit comments