Skip to content

Commit

Permalink
Bugfix remove query string inclusion in body class generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-17h committed Dec 18, 2024
1 parent 09b88e6 commit 432b5d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/6493.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed body class handling to prevent query string inclusion in is-adding-contenttype.@Abhishek-17h
7 changes: 5 additions & 2 deletions packages/volto/src/components/theme/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ export class App extends Component {
this.props.pathname !== '/',
siteroot: this.props.pathname === '/',
[`is-adding-contenttype-${decodeURIComponent(
this.props.location?.search?.replace('?type=', ''),
this.props.location?.search?.startsWith('?type=')
? this.props.location?.search?.replace('?type=', '')
: '',
)
.replaceAll(' ', '-')
.toLowerCase()}`]: this.props.location?.search,
.toLowerCase()}`]:
this.props.location?.search?.startsWith('?type='),
'is-authenticated': !!this.props.token,
'is-anonymous': !this.props.token,
'cms-ui': isCmsUI,
Expand Down

0 comments on commit 432b5d6

Please sign in to comment.