Skip to content

Commit e315ae3

Browse files
committed
Cherry picked Prevent Section URL Retention fix
1 parent 393179d commit e315ae3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
7878

7979
const clickedSectionAlias = manifest.alias;
8080

81-
// If the clicked section is the same as the current section, we just load the original section path to load the section root
82-
if (this._currentSectionAlias === clickedSectionAlias) {
81+
// If preventUrlRetention is set to true then go to the section root.
82+
// Or if the clicked section is the current active one, then navigate to the section root
83+
if (manifest?.meta.preventUrlRetention === true || this._currentSectionAlias === clickedSectionAlias) {
8384
const sectionPath = this.#getSectionPath(manifest);
8485
history.pushState(null, '', sectionPath);
8586
return;

src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export interface ManifestSection
1212
export interface MetaSection {
1313
label: string;
1414
pathname: string;
15+
preventUrlRetention?: boolean;
1516
}

0 commit comments

Comments
 (0)