File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
common/authentication/auth-walls Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 3232 id : release-name
3333 run : |
3434 echo release-name=$(curl https://api.github.com/repos/bcgov/onroutebc/releases/latest | jq -r .tag_name) >> $GITHUB_OUTPUT
35- echo release-num=V$(curl https://api.github.com/repos/bcgov/onroutebc/releases/latest | jq -r .tag_name | sed 's/[^0-9]//g') >> $GITHUB_OUTPUT
35+ echo release-num=V$(curl https://api.github.com/repos/bcgov/onroutebc/releases/latest | jq -r .tag_name | sed 's/[^0-9. ]//g') >> $GITHUB_OUTPUT
3636 promote-images-release :
3737 name : Promote Images - Release
3838 needs : [vars]
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { IDPS } from "../../types/idp";
77import { LoadBCeIDUserContext } from "../LoadBCeIDUserContext" ;
88import OnRouteBCContext from "../OnRouteBCContext" ;
99
10- const isBCeID = ( identityProvider : string ) => identityProvider === IDPS . BCEID ;
10+ const isBCeID = ( identityProvider : string ) => identityProvider === IDPS . BUSINESS_BCEID ;
1111
1212/**
1313 * This component ensures that a page is only available to new BCeID users.
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ export const CartContextProvider = ({
1010} : {
1111 children ?: React . ReactNode ;
1212} ) => {
13- const { companyId } = useContext ( OnRouteBCContext ) ;
13+ const { companyId, userDetails, idirUserDetails } = useContext ( OnRouteBCContext ) ;
14+ const doesUserDetailsExist = Boolean ( userDetails ) || Boolean ( idirUserDetails ) ;
1415
1516 // Set cart count for company
1617 const cartCountQuery = useGetCartCount (
1718 getDefaultRequiredVal ( 0 , companyId ) ,
19+ doesUserDetailsExist ,
1820 ) ;
1921
2022 const { data : fetchedCartCount } = cartCountQuery ;
Original file line number Diff line number Diff line change @@ -80,13 +80,17 @@ export const useRemoveFromCart = () => {
8080/**
8181 * Hook used to get the number of items in the cart.
8282 * @param companyId id of company to get cart item count for
83+ * @param doesUserDetailsExist Does the user details exist in the OnRouteBCContext
8384 * @returns Query object used for getting cart item count
8485 */
85- export const useGetCartCount = ( companyId : number ) => {
86+ export const useGetCartCount = (
87+ companyId : number ,
88+ doesUserDetailsExist : boolean ,
89+ ) => {
8690 return useQuery ( {
8791 queryKey : [ CART_COUNT_KEY , companyId ] ,
8892 queryFn : ( ) => getCartCount ( companyId ) ,
89- enabled : Boolean ( companyId ) ,
93+ enabled : Boolean ( companyId ) && doesUserDetailsExist ,
9094 retry : false ,
9195 refetchOnMount : "always" ,
9296 refetchOnWindowFocus : false ,
You can’t perform that action at this time.
0 commit comments