Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: store nsdocs correctly for descriptions (closes #1605) #1606

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading