comment and fixing index

This commit is contained in:
Niels Lyngsø
2024-06-28 12:25:55 +02:00
parent ac30c8c147
commit 6adb6e3ff7
4 changed files with 2 additions and 31 deletions

View File

@@ -85,17 +85,7 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement {
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
});
const oldValue = this._routes;
// is there any differences in the amount ot the paths? [NL]
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
if (oldValue && oldValue.length === routes.length) {
// is there any differences in the paths? [NL]
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
if (!hasDifferences) return;
}
this._routes = routes;
this.requestUpdate('_routes', oldValue);
}
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {

View File

@@ -101,7 +101,8 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement {
const route = routes.find((route) => route.path === this.#appCulture);
if (!route) {
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 2].path}`);
// TODO: Notice: here is a specific index used for fallback, this could be made more solid [NL]
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
return;
}

View File

@@ -85,17 +85,7 @@ export class UmbMediaWorkspaceEditorElement extends UmbLitElement {
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
});
const oldValue = this._routes;
// is there any differences in the amount ot the paths? [NL]
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
if (oldValue && oldValue.length === routes.length) {
// is there any differences in the paths? [NL]
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
if (!hasDifferences) return;
}
this._routes = routes;
this.requestUpdate('_routes', oldValue);
}
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {

View File

@@ -87,17 +87,7 @@ export class UmbMemberWorkspaceEditorElement extends UmbLitElement {
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
});
const oldValue = this._routes;
// is there any differences in the amount ot the paths? [NL]
// TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL]
if (oldValue && oldValue.length === routes.length) {
// is there any differences in the paths? [NL]
const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path);
if (!hasDifferences) return;
}
this._routes = routes;
this.requestUpdate('_routes', oldValue);
}
private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => {