File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/compas-open-scd/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,8 @@ export class OpenSCD extends LitElement {
141
141
this . compasApi = {
142
142
lNodeLibrary : {
143
143
loadLNodeLibrary : async ( ) => {
144
- if ( this . _lNodeLibrary ) return this . _lNodeLibrary ;
145
- this . _lNodeLibrary = await this . loadLNodeLibrary ( ) ;
146
- return this . _lNodeLibrary ;
144
+ const doc = await this . loadLNodeLibrary ( ) ;
145
+ return doc ;
147
146
} ,
148
147
lNodeLibrary : ( ) => this . _lNodeLibrary ,
149
148
} ,
@@ -153,7 +152,11 @@ export class OpenSCD extends LitElement {
153
152
private async loadLNodeLibrary ( ) : Promise < Document | null > {
154
153
try {
155
154
const doc = await CompasSclDataService ( ) . getSclDocument ( this , 'SSD' , LNODE_LIB_DOC_ID ) ;
156
- return doc instanceof Document ? doc : null ;
155
+ if ( doc instanceof Document ) {
156
+ this . _lNodeLibrary = doc ;
157
+ return doc ;
158
+ }
159
+ return null ;
157
160
} catch ( reason ) {
158
161
createLogEvent ( this , reason ) ;
159
162
return null ;
You can’t perform that action at this time.
0 commit comments