Skip to content

Commit

Permalink
Fix template loading
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Dec 1, 2021
1 parent 921c2d5 commit ef9afa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class CSLPlugin {

convert(item, template) {
let csl = {}
let fields = template.fields || template.field

for (let { property, label } of template.field) {
for (let { property, label } of fields) {
if (property in item) {
csl[label] = cast(item[property][0]?.['@value'], label)
}
Expand All @@ -31,7 +32,7 @@ class CSLPlugin {
let out = []
let exp = await this.expand(data)
let template = loadTemplate(
this.context.win?.store.getState(),
this.context.window?.store.getState(),
this.options.template)

// TODO check if item or photo template
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
],
"devDependencies": {
"electron": "^10.1.4",
"electron-mocha": "^9.3.0"
"electron": "^16.0.3",
"electron-mocha": "^11.0.2"
}
}

0 comments on commit ef9afa1

Please sign in to comment.