From d192f9ea551aafe02a63e4b26d1c7a60984eeefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 16 Oct 2024 10:53:41 +0200 Subject: [PATCH] fix live editing mode --- .../block/context/block-manager.context.ts | 2 +- .../workspace/block-workspace.context.ts | 21 +++++++++++-------- .../element-property-dataset.context.ts | 1 - 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts index c650cee4c0..59109b8945 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/context/block-manager.context.ts @@ -78,7 +78,7 @@ export abstract class UmbBlockManagerContext< setEditorConfiguration(configs: UmbPropertyEditorConfigCollection) { this._editorConfiguration.setValue(configs); if (this._liveEditingMode.getValue() === undefined) { - this._liveEditingMode.setValue(configs.getValueByAlias('liveEditingMode')); + this._liveEditingMode.setValue(configs.getValueByAlias('useLiveEditing')); } } getEditorConfiguration(): UmbPropertyEditorConfigCollection | undefined { diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts index df8349a9c3..4ea9f4370d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts @@ -45,6 +45,7 @@ export class UmbBlockWorkspaceContext; #liveEditingMode?: boolean; #initialLayout?: LayoutDataType; @@ -87,13 +88,13 @@ export class UmbBlockWorkspaceContext { this.#blockManager = manager; - this.observe( + this.#liveEditingModePromise = this.observe( manager.liveEditingMode, (liveEditingMode) => { this.#liveEditingMode = liveEditingMode; }, 'observeLiveEditingMode', - ); + ).asPromise(); this.observe( observeMultiple([ @@ -212,6 +213,7 @@ export class UmbBlockWorkspaceContext { - console.log('props', props); const map = props.map((prop) => ({ alias: prop.alias, variantId: this.#createPropertyVariantId(prop) })); this.#propertyVariantIdMap.setValue(map); // Resolve promise, to let the once waiting on this know.