From 168ad1031f8bda2604a1caa32a98007b60900471 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Tue, 14 Feb 2023 10:48:36 +0600 Subject: [PATCH] Edit doc update fix (#2632) Signed-off-by: Denis Bykhov --- .../view-resources/src/components/EditDoc.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/view-resources/src/components/EditDoc.svelte b/plugins/view-resources/src/components/EditDoc.svelte index 0aed4dba5b..469e6472fc 100644 --- a/plugins/view-resources/src/components/EditDoc.svelte +++ b/plugins/view-resources/src/components/EditDoc.svelte @@ -116,7 +116,7 @@ let inplaceAttributes: string[] = [] let ignoreMixins: Set>> = new Set>>() - async function updateKeys (showAllMixins: boolean): Promise { + async function updateKeys (): Promise { const keysMap = new Map(getFiltredKeys(hierarchy, realObjectClass, ignoreKeys).map((p) => [p.attr._id, p])) for (const m of mixins) { const mkeys = getFiltredKeys(hierarchy, m._id, ignoreKeys) @@ -170,12 +170,12 @@ $: editorFooter = getEditorFooter(_class) - $: getEditorOrDefault(realObjectClass, showAllMixins, _id) + $: getEditorOrDefault(realObjectClass, _id) - function getEditorOrDefault (_class: Ref>, showAllMixins: boolean, _id: Ref): void { + async function getEditorOrDefault (_class: Ref>, _id: Ref): Promise { parentClass = hierarchy.getParentClass(_class) + await updateKeys() mainEditor = getEditor(_class) - updateKeys(showAllMixins) } async function getFieldEditor (key: KeyedAttribute): Promise { @@ -267,7 +267,7 @@ allowedCollections = ev.detail.allowedCollections ?? [] collectionArrays = ev.detail.collectionArrays ?? [] getMixins(parentClass, object, showAllMixins) - updateKeys(showAllMixins) + updateKeys() } @@ -323,7 +323,7 @@ updateKeys(showAllMixins)} + on:update={updateKeys} /> {:else if dir === 'column'} updateKeys(showAllMixins)} + on:update={updateKeys} /> {:else}