Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ export class UmbRouterSlotElement extends UmbLitElement {
public set routes(value: UmbRoute[] | undefined) {
value ??= [];
const oldValue = this.#router.routes;
if (
value.length !== oldValue?.length ||
value.filter((route) => oldValue?.findIndex((r) => r.path === route.path) === -1).length > 0
) {
if (value.length !== oldValue?.length || value.some((route, index) => route !== oldValue?.[index])) {
this.#router.routes = value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export class UmbViewController extends UmbControllerBase {

public readonly viewAlias: string | null;

#destroyed = false;

#variantId = new UmbClassState<UmbVariantId | undefined>(undefined);
protected readonly variantId = this.#variantId.asObservable();

Expand Down Expand Up @@ -127,7 +129,7 @@ export class UmbViewController extends UmbControllerBase {
}

public provideAt(controllerHost: UmbClassInterface): void {
if (this.#currentProvideHost === controllerHost) return;
if (this.#destroyed || this.#currentProvideHost === controllerHost) return;

this.unprovide();

Expand Down Expand Up @@ -357,10 +359,10 @@ export class UmbViewController extends UmbControllerBase {
}

override destroy(): void {
this.#destroyed = true;
this.#inherit = false;
this.#removeActive();
this.#autoActivate = false;
(this as any).provideAt = undefined;
this.unprovide();
super.destroy();
this.#consumeParentCtrl = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,20 @@ export class UmbDocumentWorkspaceContext

async create(parent: UmbEntityModel, documentTypeUnique: string, blueprintUnique?: string) {
if (blueprintUnique) {
// Reset state and set loading immediately, before the async blueprint data fetch.
// This ensures the workspace shows a loading indicator while the data is being fetched,
// preventing the previous workspace editor's inner router from firing history.replaceState
// (via the default-variant redirect route) which would cancel the outer navigation. (#21996)
this.resetState();
this.loading.addState({ unique: 'blueprint-fetch' });

const blueprintRepository = new UmbDocumentBlueprintDetailRepository(this);
const { data } = await blueprintRepository.scaffoldByUnique(blueprintUnique);

if (!data) throw new Error('Blueprint data is missing');
if (!data) {
this.loading.removeState('blueprint-fetch');
throw new Error('Blueprint data is missing');
}
Comment thread
AndyButland marked this conversation as resolved.

return this.createScaffold({
Comment thread
AndyButland marked this conversation as resolved.
parent,
Expand Down
Loading