Skip to content

Commit

Permalink
fix: change landing page for Junior Buyers to Shopping Lists instead …
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and libruce committed Feb 22, 2024
1 parent 70539c1 commit 7e805d5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/storefront/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export default function Login(props: RegisteredProps) {
if (info?.userType === 3 && info?.role === 3) {
navigate('/dashboard')
} else if (info?.role === 2) {
navigate('/accountSettings')
navigate('/shoppingLists')
} else {
navigate('/orders')
}
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/shared/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ const gotoAllowedAppPage = async (
)
switch (role) {
case 2:
url = '/accountSettings'
url = '/shoppingLists'
break
case 3:
url = '/dashboard'
Expand Down
10 changes: 5 additions & 5 deletions apps/storefront/src/utils/b3AccountItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const redirectBcMenus = (
if (key.includes('/account.php') && !key.includes('?')) {
switch (role) {
case 2:
return '/accountSettings'
return '/shoppingLists'
case 3:
return '/dashboard'
default:
Expand All @@ -69,14 +69,14 @@ const redirectBcMenus = (
}

if (+role === 2 && currentItem?.newTargetUrl?.includes('order_status')) {
return '/accountSettings'
return '/shoppingLists'
}

if (currentItem?.newTargetUrl) {
return currentItem.newTargetUrl
}

return +role === 2 ? '/accountSettings' : '/orders'
return +role === 2 ? '/shoppingLists' : '/orders'
}

const getCurrentLoginUrl = (href: string): string => {
Expand Down Expand Up @@ -105,12 +105,12 @@ const openPageByClick = ({
if (
+role === 2 &&
(href?.includes('/orders') ||
href?.includes('/accountSettings') ||
href?.includes('/shoppingLists') ||
href?.includes('/login') ||
href?.includes('/account')) &&
!href?.includes('logout')
) {
return '/accountSettings'
return '/shoppingLists'
}
// register and login click
if (href?.includes('/login') || isRegisterAndLogin || role === 100) {
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/useB3AppOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const useB3AppOpen = (initOpenState: OpenPageState) => {
!href.includes('action=create_account') &&
!href.includes('action=logout')
) {
href = +B3Role === 2 ? '/accountSettings' : '/orders'
href = +B3Role === 2 ? '/shoppingLists' : '/orders'
}

if (initOpenState?.handleEnterClick) {
Expand Down

0 comments on commit 7e805d5

Please sign in to comment.