From 5e2b741d68520bf029dd8cf420fe2721b880defe Mon Sep 17 00:00:00 2001 From: Daniel Mulholland Date: Fri, 29 Nov 2024 07:40:50 +1300 Subject: [PATCH] fix: store nsdocs correctly for descriptions (closes #1605) --- packages/openscd/src/foundation/nsdoc.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/openscd/src/foundation/nsdoc.ts b/packages/openscd/src/foundation/nsdoc.ts index 53775fea7..810969c6a 100644 --- a/packages/openscd/src/foundation/nsdoc.ts +++ b/packages/openscd/src/foundation/nsdoc.ts @@ -10,12 +10,17 @@ export interface Nsdoc { const [nsd72, nsd73, nsd74, nsd81] = await Promise.all([iec6185072, iec6185073, iec6185074, iec6185081]); +let nsdoc72: Document | undefined = undefined; +let nsdoc73: Document | undefined = undefined; +let nsdoc74: Document | undefined = undefined; +let nsdoc81: Document | undefined = undefined; + /** * Initialize the full Nsdoc object. * @returns A fully initialized Nsdoc object for wizards/editors to use. */ export function initializeNsdoc(): Nsdoc { - const [nsdoc72, nsdoc73, nsdoc74, nsdoc81] = [ + [nsdoc72, nsdoc73, nsdoc74, nsdoc81] = [ localStorage.getItem('IEC 61850-7-2') ? new DOMParser().parseFromString(localStorage.getItem('IEC 61850-7-2')!, 'application/xml') : undefined, localStorage.getItem('IEC 61850-7-3') ? new DOMParser().parseFromString(localStorage.getItem('IEC 61850-7-3')!, 'application/xml') : undefined, localStorage.getItem('IEC 61850-7-4') ? new DOMParser().parseFromString(localStorage.getItem('IEC 61850-7-4')!, 'application/xml') : undefined,