From ba9b3519deb76c0cb15c88daae13dda0e803d917 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Tue, 16 Mar 2021 10:29:56 -0600 Subject: [PATCH] ui: fix isEdited for unions --- ui/src/app/app-config/config-cursor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/app/app-config/config-cursor.ts b/ui/src/app/app-config/config-cursor.ts index b7b63558a..82b7e657e 100644 --- a/ui/src/app/app-config/config-cursor.ts +++ b/ui/src/app/app-config/config-cursor.ts @@ -298,11 +298,11 @@ export class ConfigCursor { const mappedCfg = this.mappedConfig() if (cfg && mappedCfg && typeof cfg === 'object' && typeof mappedCfg === 'object') { const spec = this.spec() - let allKeys + let allKeys: Set if (spec.type === 'union') { let unionSpec = spec as ValueSpecOf<'union'> const labelForSelection = unionSpec.tag.id - allKeys = new Set([...Object.keys(unionSpec.variants[cfg[labelForSelection]])]) + allKeys = new Set([labelForSelection, ...Object.keys(unionSpec.variants[cfg[labelForSelection]])]) } else { allKeys = new Set([...Object.keys(cfg), ...Object.keys(mappedCfg)]) }