Skip to content

Commit

Permalink
fix: theme compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and CarlLiu2023 committed Sep 8, 2023
1 parent bea23bb commit 88c03c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions apps/storefront/src/utils/b3AccountItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const redirectBcMenus = (
// superAdmin exits's url
const superAdminExistUrl = ['/accountSettings']
const currentItem: CustomFieldItems =
accountTarget.find((item) => key.includes(item.originUrl)) || {}
accountTarget.find((item) => key?.includes(item.originUrl)) || {}

// super admin
if (currentItem?.newTargetUrl && +role === 3) {
Expand All @@ -70,7 +70,7 @@ const redirectBcMenus = (

const getCurrentLoginUrl = (href: string): string => {
// quit login
if (href.includes('logout')) {
if (href?.includes('logout')) {
return '/login?loginFlag=3'
}

Expand All @@ -87,11 +87,11 @@ const openPageByClick = ({
isRegisterAndLogin,
isAgenting,
}: OpenPageByClickProps) => {
if (href.includes('/orders')) {
if (href?.includes('/orders')) {
return role !== 100 ? '/orders' : '/login'
}
// register and login click
if (href.includes('/login') || isRegisterAndLogin || role === 100) {
if (href?.includes('/login') || isRegisterAndLogin || role === 100) {
return getCurrentLoginUrl(href)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/global-b3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const themeOtherElementConfig = () => {
'[href="/account.php"] svg, [href="/account.php"] svg use, [href="/account.php"] span, [href="/account.php"], [href="/login.php"] span, [href="/login.php"] svg use, [href="/login.php"] svg, [href="/login.php"]',
SuperMarket: '[href="/login.php"] span, [href="/account.php"] span',
LifeStyle:
'.navUser-item--account a svg, .navUser-item--account a, .navUser-item .needsclick, .navUser-item .needsclick svg, .navUser-item .needsclick span, .navUser-item a, .navUser-item a svg, .navUser-item a svg use, .navUser-item a span',
'.navUser-item--account a, .navUser-item--account a svg, .navUser-section-sub .navUser-item .needsclick, .navUser-section-sub .navUser-item .needsclick svg, .navUser-section-sub .navUser-item .needsclick span, .navUser-section-sub .navUser-item a, .navUser-section-sub .navUser-item a svg, .navUser-section-sub .navUser-item a svg use, .navUser-section-sub .navUser-item a span',
}

if (window?.B3CustomConfig) {
Expand Down

0 comments on commit 88c03c8

Please sign in to comment.