Skip to content

Commit

Permalink
fix: guest shopping list issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 committed Apr 28, 2023
1 parent f4229d8 commit 5d33d4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/storefront/src/components/layout/B3Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function B3Nav({ closeSidebar }: B3NavProps) {
open: true,
title: 'Registration',
message:
'To receive full access to buyer portal, please register. It will take 2 minutes. ',
'Please create an account, or login to create a shopping list.',
cancelText: 'Cancel',
saveText: 'Register',
saveFn: jumpRegister,
Expand Down
1 change: 1 addition & 0 deletions apps/storefront/src/hooks/dom/useDomHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const useDomHooks = ({ setOpenPage }: MutationObserverProps) => {

useOpenPDP({
setOpenPage,
role,
})

useRegisteredbctob2b(setOpenPage)
Expand Down
4 changes: 3 additions & 1 deletion apps/storefront/src/hooks/dom/useOpenPDP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import { removeElement } from './utils'

interface MutationObserverProps {
setOpenPage: Dispatch<SetStateAction<OpenPageState>>
role: number | string
}

const useOpenPDP = ({ setOpenPage }: MutationObserverProps) => {
const useOpenPDP = ({ setOpenPage, role }: MutationObserverProps) => {
const {
state: { shoppingListBtn },
} = useContext(CustomStyleContext)
Expand Down Expand Up @@ -56,6 +57,7 @@ const useOpenPDP = ({ setOpenPage }: MutationObserverProps) => {
} = shoppingListBtn

useEffect(() => {
if (role === 100) return
const addToShoppingListAll = document.querySelectorAll(
globalB3['dom.setToShoppingListParentEl']
)
Expand Down

0 comments on commit 5d33d4e

Please sign in to comment.