Skip to content

Commit 929ab5b

Browse files
committed
comment and fixing index
1 parent 07e14db commit 929ab5b

File tree

4 files changed

+2
-31
lines changed

4 files changed

+2
-31
lines changed

src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,7 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement {
8585
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
8686
});
8787

88-
const oldValue = this._routes;
89-
90-
// is there any differences in the amount ot the paths? [NL]
91-
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
92-
if (oldValue && oldValue.length === routes.length) {
93-
// is there any differences in the paths? [NL]
94-
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
95-
if (!hasDifferences) return;
96-
}
9788
this._routes = routes;
98-
this.requestUpdate('_routes', oldValue);
9989
}
10090

10191
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {

src/packages/documents/documents/workspace/document-workspace-editor.element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement {
101101
const route = routes.find((route) => route.path === this.#appCulture);
102102

103103
if (!route) {
104-
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 2].path}`);
104+
// TODO: Notice: here is a specific index used for fallback, this could be made more solid [NL]
105+
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
105106
return;
106107
}
107108

src/packages/media/media/workspace/media-workspace-editor.element.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,7 @@ export class UmbMediaWorkspaceEditorElement extends UmbLitElement {
8585
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
8686
});
8787

88-
const oldValue = this._routes;
89-
90-
// is there any differences in the amount ot the paths? [NL]
91-
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
92-
if (oldValue && oldValue.length === routes.length) {
93-
// is there any differences in the paths? [NL]
94-
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
95-
if (!hasDifferences) return;
96-
}
9788
this._routes = routes;
98-
this.requestUpdate('_routes', oldValue);
9989
}
10090

10191
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {

src/packages/members/member/workspace/member-workspace-editor.element.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,7 @@ export class UmbMemberWorkspaceEditorElement extends UmbLitElement {
8787
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
8888
});
8989

90-
const oldValue = this._routes;
91-
92-
// is there any differences in the amount ot the paths? [NL]
93-
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
94-
if (oldValue && oldValue.length === routes.length) {
95-
// is there any differences in the paths? [NL]
96-
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
97-
if (!hasDifferences) return;
98-
}
9990
this._routes = routes;
100-
this.requestUpdate('_routes', oldValue);
10191
}
10292

10393
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {

0 commit comments

Comments
 (0)