Skip to content

Commit

Permalink
fix: store nsdocs correctly for descriptions (closes #1605)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyill committed Nov 28, 2024
1 parent 9c5859e commit 5e2b741
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/openscd/src/foundation/nsdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5e2b741

Please sign in to comment.