Skip to content

Commit a4deaf0

Browse files
authored
fix(next): incorrect stepnav breadcrumbs after selecting existing upload (#6372)
## Description Fixes [this](payloadcms/payload-3.0-demo#202) v3 demo issue - [x] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] Existing test suite passes locally with my changes
1 parent 4adf01a commit a4deaf0

File tree

1 file changed

+11
-6
lines changed
  • packages/next/src/views/List/Default

1 file changed

+11
-6
lines changed

packages/next/src/views/List/Default/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useWindowInfo } from '@payloadcms/ui/elements/WindowInfo'
2222
import { SetViewActions } from '@payloadcms/ui/providers/Actions'
2323
import { useComponentMap } from '@payloadcms/ui/providers/ComponentMap'
2424
import { useConfig } from '@payloadcms/ui/providers/Config'
25+
import { useEditDepth } from '@payloadcms/ui/providers/EditDepth'
2526
import { useListInfo } from '@payloadcms/ui/providers/ListInfo'
2627
import { useListQuery } from '@payloadcms/ui/providers/ListQuery'
2728
import { useSearchParams } from '@payloadcms/ui/providers/SearchParams'
@@ -65,6 +66,8 @@ export const DefaultListView: React.FC = () => {
6566

6667
const { i18n } = useTranslation()
6768

69+
const drawerDepth = useEditDepth()
70+
6871
const { setStepNav } = useStepNav()
6972

7073
const {
@@ -83,12 +86,14 @@ export const DefaultListView: React.FC = () => {
8386
}
8487

8588
useEffect(() => {
86-
setStepNav([
87-
{
88-
label: labels?.plural,
89-
},
90-
])
91-
}, [setStepNav, labels])
89+
if (drawerDepth <= 1) {
90+
setStepNav([
91+
{
92+
label: labels?.plural,
93+
},
94+
])
95+
}
96+
}, [setStepNav, labels, drawerDepth])
9297

9398
return (
9499
<div className={baseClass}>

0 commit comments

Comments
 (0)