Commit 7e82642 1 parent e199376 commit 7e82642 Copy full SHA for 7e82642
File tree 4 files changed +11
-5
lines changed
common/authentication/auth-walls
4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 32
32
id : release-name
33
33
run : |
34
34
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
36
36
promote-images-release :
37
37
name : Promote Images - Release
38
38
needs : [vars]
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { IDPS } from "../../types/idp";
7
7
import { LoadBCeIDUserContext } from "../LoadBCeIDUserContext" ;
8
8
import OnRouteBCContext from "../OnRouteBCContext" ;
9
9
10
- const isBCeID = ( identityProvider : string ) => identityProvider === IDPS . BCEID ;
10
+ const isBCeID = ( identityProvider : string ) => identityProvider === IDPS . BUSINESS_BCEID ;
11
11
12
12
/**
13
13
* 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 = ({
10
10
} : {
11
11
children ?: React . ReactNode ;
12
12
} ) => {
13
- const { companyId } = useContext ( OnRouteBCContext ) ;
13
+ const { companyId, userDetails, idirUserDetails } = useContext ( OnRouteBCContext ) ;
14
+ const doesUserDetailsExist = Boolean ( userDetails ) || Boolean ( idirUserDetails ) ;
14
15
15
16
// Set cart count for company
16
17
const cartCountQuery = useGetCartCount (
17
18
getDefaultRequiredVal ( 0 , companyId ) ,
19
+ doesUserDetailsExist ,
18
20
) ;
19
21
20
22
const { data : fetchedCartCount } = cartCountQuery ;
Original file line number Diff line number Diff line change @@ -80,13 +80,17 @@ export const useRemoveFromCart = () => {
80
80
/**
81
81
* Hook used to get the number of items in the cart.
82
82
* @param companyId id of company to get cart item count for
83
+ * @param doesUserDetailsExist Does the user details exist in the OnRouteBCContext
83
84
* @returns Query object used for getting cart item count
84
85
*/
85
- export const useGetCartCount = ( companyId : number ) => {
86
+ export const useGetCartCount = (
87
+ companyId : number ,
88
+ doesUserDetailsExist : boolean ,
89
+ ) => {
86
90
return useQuery ( {
87
91
queryKey : [ CART_COUNT_KEY , companyId ] ,
88
92
queryFn : ( ) => getCartCount ( companyId ) ,
89
- enabled : Boolean ( companyId ) ,
93
+ enabled : Boolean ( companyId ) && doesUserDetailsExist ,
90
94
retry : false ,
91
95
refetchOnMount : "always" ,
92
96
refetchOnWindowFocus : false ,
You can’t perform that action at this time.
0 commit comments